{"action":"created","comment":{"url":"https://api.github.com/repos/intel-hadoop/gearpump/pulls/comments/31228317","id":31228317,"diff_hunk":"@@ -0,0 +1,57 @@\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.gearpump.streaming.state.user.example.processor\n+\n+import com.twitter.algebird.{AveragedGroup, AveragedValue}\n+import org.apache.gearpump.Message\n+import org.apache.gearpump.cluster.UserConfig\n+import org.apache.gearpump.streaming.state.system.impl.PersistentStateConfig\n+import org.apache.gearpump.streaming.state.user.api.PersistentTask\n+import org.apache.gearpump.streaming.task.{StartTime, TaskContext}\n+import org.apache.gearpump.util.LogUtil\n+import org.slf4j.Logger\n+\n+object WindowAverageProcessor {\n+  val LOG: Logger = LogUtil.getLogger(classOf[WindowAverageProcessor])\n+}\n+\n+class WindowAverageProcessor(taskContext : TaskContext, conf: UserConfig)\n+  extends PersistentTask[AveragedValue](taskContext, conf) {\n+\n+  private val windowSize = conf.getLong(PersistentStateConfig.STATE_WINDOW_SIZE)\n+    .getOrElse(throw new RuntimeException(\"state window size not configured\"))","path":"experiments/state/src/main/scala/org/apache/gearpump/streaming/state/user/example/processor/WindowAverageProcessor.scala","position":38,"original_position":38,"commit_id":"6e0a81e21598099940aaa3e404c020fef9adce48","original_commit_id":"6e0a81e21598099940aaa3e404c020fef9adce48","user":{"login":"clockfly","id":2595532,"avatar_url":"https://avatars.githubusercontent.com/u/2595532?v=3","gravatar_id":"","url":"https://api.github.com/users/clockfly","html_url":"https://github.com/clockfly","followers_url":"https://api.github.com/users/clockfly/followers","following_url":"https://api.github.com/users/clockfly/following{/other_user}","gists_url":"https://api.github.com/users/clockfly/gists{/gist_id}","starred_url":"https://api.github.com/users/clockfly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clockfly/subscriptions","organizations_url":"https://api.github.com/users/clockfly/orgs","repos_url":"https://api.github.com/users/clockfly/repos","events_url":"https://api.github.com/users/clockfly/events{/privacy}","received_events_url":"https://api.github.com/users/clockfly/received_events","type":"User","site_admin":false},"body":"We should never throw RuntimeException in actor.\r\n\r\nException should also be avoided.","created_at":"2015-05-28T12:39:47Z","updated_at":"2015-05-28T12:39:47Z","html_url":"https://github.com/intel-hadoop/gearpump/pull/951#discussion_r31228317","pull_request_url":"https://api.github.com/repos/intel-hadoop/gearpump/pulls/951","_links":{"self":{"href":"https://api.github.com/repos/intel-hadoop/gearpump/pulls/comments/31228317"},"html":{"href":"https://github.com/intel-hadoop/gearpump/pull/951#discussion_r31228317"},"pull_request":{"href":"https://api.github.com/repos/intel-hadoop/gearpump/pulls/951"}}},"pull_request":{"url":"https://api.github.com/repos/intel-hadoop/gearpump/pulls/951","id":36180965,"html_url":"https://github.com/intel-hadoop/gearpump/pull/951","diff_url":"https://github.com/intel-hadoop/gearpump/pull/951.diff","patch_url":"https://github.com/intel-hadoop/gearpump/pull/951.patch","issue_url":"https://api.github.com/repos/intel-hadoop/gearpump/issues/951","number":951,"state":"open","locked":false,"title":"fix #6, add transaction api","user":{"login":"manuzhang","id":1191767,"avatar_url":"https://avatars.githubusercontent.com/u/1191767?v=3","gravatar_id":"","url":"https://api.github.com/users/manuzhang","html_url":"https://github.com/manuzhang","followers_url":"https://api.github.com/users/manuzhang/followers","following_url":"https://api.github.com/users/manuzhang/following{/other_user}","gists_url":"https://api.github.com/users/manuzhang/gists{/gist_id}","starred_url":"https://api.github.com/users/manuzhang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/manuzhang/subscriptions","organizations_url":"https://api.github.com/users/manuzhang/orgs","repos_url":"https://api.github.com/users/manuzhang/repos","events_url":"https://api.github.com/users/manuzhang/events{/privacy}","received_events_url":"https://api.github.com/users/manuzhang/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-05-26T08:50:05Z","updated_at":"2015-05-28T12:39:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"240c6cb91bf553facb50d4d0af3bc571fce1a27b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/intel-hadoop/gearpump/pulls/951/commits","review_comments_url":"https://api.github.com/repos/intel-hadoop/gearpump/pulls/951/comments","review_comment_url":"https://api.github.com/repos/intel-hadoop/gearpump/pulls/comments{/number}","comments_url":"https://api.github.com/repos/intel-hadoop/gearpump/issues/951/comments","statuses_url":"https://api.github.com/repos/intel-hadoop/gearpump/statuses/6e0a81e21598099940aaa3e404c020fef9adce48","head":{"label":"manuzhang:transaction_4","ref":"transaction_4","sha":"6e0a81e21598099940aaa3e404c020fef9adce48","user":{"login":"manuzhang","id":1191767,"avatar_url":"https://avatars.githubusercontent.com/u/1191767?v=3","gravatar_id":"","url":"https://api.github.com/users/manuzhang","html_url":"https://github.com/manuzhang","followers_url":"https://api.github.com/users/manuzhang/followers","following_url":"https://api.github.com/users/manuzhang/following{/other_user}","gists_url":"https://api.github.com/users/manuzhang/gists{/gist_id}","starred_url":"https://api.github.com/users/manuzhang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/manuzhang/subscriptions","organizations_url":"https://api.github.com/users/manuzhang/orgs","repos_url":"https://api.github.com/users/manuzhang/repos","events_url":"https://api.github.com/users/manuzhang/events{/privacy}","received_events_url":"https://api.github.com/users/manuzhang/received_events","type":"User","site_admin":false},"repo":{"id":23787570,"name":"gearpump","full_name":"manuzhang/gearpump","owner":{"login":"manuzhang","id":1191767,"avatar_url":"https://avatars.githubusercontent.com/u/1191767?v=3","gravatar_id":"","url":"https://api.github.com/users/manuzhang","html_url":"https://github.com/manuzhang","followers_url":"https://api.github.com/users/manuzhang/followers","following_url":"https://api.github.com/users/manuzhang/following{/other_user}","gists_url":"https://api.github.com/users/manuzhang/gists{/gist_id}","starred_url":"https://api.github.com/users/manuzhang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/manuzhang/subscriptions","organizations_url":"https://api.github.com/users/manuzhang/orgs","repos_url":"https://api.github.com/users/manuzhang/repos","events_url":"https://api.github.com/users/manuzhang/events{/privacy}","received_events_url":"https://api.github.com/users/manuzhang/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/manuzhang/gearpump","description":"gearpump","fork":true,"url":"https://api.github.com/repos/manuzhang/gearpump","forks_url":"https://api.github.com/repos/manuzhang/gearpump/forks","keys_url":"https://api.github.com/repos/manuzhang/gearpump/keys{/key_id}","collaborators_url":"https://api.github.com/repos/manuzhang/gearpump/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/manuzhang/gearpump/teams","hooks_url":"https://api.github.com/repos/manuzhang/gearpump/hooks","issue_events_url":"https://api.github.com/repos/manuzhang/gearpump/issues/events{/number}","events_url":"https://api.github.com/repos/manuzhang/gearpump/events","assignees_url":"https://api.github.com/repos/manuzhang/gearpump/assignees{/user}","branches_url":"https://api.github.com/repos/manuzhang/gearpump/branches{/branch}","tags_url":"https://api.github.com/repos/manuzhang/gearpump/tags","blobs_url":"https://api.github.com/repos/manuzhang/gearpump/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/manuzhang/gearpump/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/manuzhang/gearpump/git/refs{/sha}","trees_url":"https://api.github.com/repos/manuzhang/gearpump/git/trees{/sha}","statuses_url":"https://api.github.com/repos/manuzhang/gearpump/statuses/{sha}","languages_url":"https://api.github.com/repos/manuzhang/gearpump/languages","stargazers_url":"https://api.github.com/repos/manuzhang/gearpump/stargazers","contributors_url":"https://api.github.com/repos/manuzhang/gearpump/contributors","subscribers_url":"https://api.github.com/repos/manuzhang/gearpump/subscribers","subscription_url":"https://api.github.com/repos/manuzhang/gearpump/subscription","commits_url":"https://api.github.com/repos/manuzhang/gearpump/commits{/sha}","git_commits_url":"https://api.github.com/repos/manuzhang/gearpump/git/commits{/sha}","comments_url":"https://api.github.com/repos/manuzhang/gearpump/comments{/number}","issue_comment_url":"https://api.github.com/repos/manuzhang/gearpump/issues/comments{/number}","contents_url":"https://api.github.com/repos/manuzhang/gearpump/contents/{+path}","compare_url":"https://api.github.com/repos/manuzhang/gearpump/compare/{base}...{head}","merges_url":"https://api.github.com/repos/manuzhang/gearpump/merges","archive_url":"https://api.github.com/repos/manuzhang/gearpump/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/manuzhang/gearpump/downloads","issues_url":"https://api.github.com/repos/manuzhang/gearpump/issues{/number}","pulls_url":"https://api.github.com/repos/manuzhang/gearpump/pulls{/number}","milestones_url":"https://api.github.com/repos/manuzhang/gearpump/milestones{/number}","notifications_url":"https://api.github.com/repos/manuzhang/gearpump/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/manuzhang/gearpump/labels{/name}","releases_url":"https://api.github.com/repos/manuzhang/gearpump/releases{/id}","created_at":"2014-09-08T10:57:13Z","updated_at":"2015-05-05T00:42:45Z","pushed_at":"2015-05-28T02:09:19Z","git_url":"git://github.com/manuzhang/gearpump.git","ssh_url":"git@github.com:manuzhang/gearpump.git","clone_url":"https://github.com/manuzhang/gearpump.git","svn_url":"https://github.com/manuzhang/gearpump","homepage":"","size":9114,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"intel-hadoop:master","ref":"master","sha":"672dbcb38a32e6db46c415f87c39a7617ab04735","user":{"login":"intel-hadoop","id":1839373,"avatar_url":"https://avatars.githubusercontent.com/u/1839373?v=3","gravatar_id":"","url":"https://api.github.com/users/intel-hadoop","html_url":"https://github.com/intel-hadoop","followers_url":"https://api.github.com/users/intel-hadoop/followers","following_url":"https://api.github.com/users/intel-hadoop/following{/other_user}","gists_url":"https://api.github.com/users/intel-hadoop/gists{/gist_id}","starred_url":"https://api.github.com/users/intel-hadoop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/intel-hadoop/subscriptions","organizations_url":"https://api.github.com/users/intel-hadoop/orgs","repos_url":"https://api.github.com/users/intel-hadoop/repos","events_url":"https://api.github.com/users/intel-hadoop/events{/privacy}","received_events_url":"https://api.github.com/users/intel-hadoop/received_events","type":"Organization","site_admin":false},"repo":{"id":22139167,"name":"gearpump","full_name":"intel-hadoop/gearpump","owner":{"login":"intel-hadoop","id":1839373,"avatar_url":"https://avatars.githubusercontent.com/u/1839373?v=3","gravatar_id":"","url":"https://api.github.com/users/intel-hadoop","html_url":"https://github.com/intel-hadoop","followers_url":"https://api.github.com/users/intel-hadoop/followers","following_url":"https://api.github.com/users/intel-hadoop/following{/other_user}","gists_url":"https://api.github.com/users/intel-hadoop/gists{/gist_id}","starred_url":"https://api.github.com/users/intel-hadoop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/intel-hadoop/subscriptions","organizations_url":"https://api.github.com/users/intel-hadoop/orgs","repos_url":"https://api.github.com/users/intel-hadoop/repos","events_url":"https://api.github.com/users/intel-hadoop/events{/privacy}","received_events_url":"https://api.github.com/users/intel-hadoop/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/intel-hadoop/gearpump","description":"Lightweight real-time big data streaming engine","fork":false,"url":"https://api.github.com/repos/intel-hadoop/gearpump","forks_url":"https://api.github.com/repos/intel-hadoop/gearpump/forks","keys_url":"https://api.github.com/repos/intel-hadoop/gearpump/keys{/key_id}","collaborators_url":"https://api.github.com/repos/intel-hadoop/gearpump/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/intel-hadoop/gearpump/teams","hooks_url":"https://api.github.com/repos/intel-hadoop/gearpump/hooks","issue_events_url":"https://api.github.com/repos/intel-hadoop/gearpump/issues/events{/number}","events_url":"https://api.github.com/repos/intel-hadoop/gearpump/events","assignees_url":"https://api.github.com/repos/intel-hadoop/gearpump/assignees{/user}","branches_url":"https://api.github.com/repos/intel-hadoop/gearpump/branches{/branch}","tags_url":"https://api.github.com/repos/intel-hadoop/gearpump/tags","blobs_url":"https://api.github.com/repos/intel-hadoop/gearpump/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/intel-hadoop/gearpump/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/intel-hadoop/gearpump/git/refs{/sha}","trees_url":"https://api.github.com/repos/intel-hadoop/gearpump/git/trees{/sha}","statuses_url":"https://api.github.com/repos/intel-hadoop/gearpump/statuses/{sha}","languages_url":"https://api.github.com/repos/intel-hadoop/gearpump/languages","stargazers_url":"https://api.github.com/repos/intel-hadoop/gearpump/stargazers","contributors_url":"https://api.github.com/repos/intel-hadoop/gearpump/contributors","subscribers_url":"https://api.github.com/repos/intel-hadoop/gearpump/subscribers","subscription_url":"https://api.github.com/repos/intel-hadoop/gearpump/subscription","commits_url":"https://api.github.com/repos/intel-hadoop/gearpump/commits{/sha}","git_commits_url":"https://api.github.com/repos/intel-hadoop/gearpump/git/commits{/sha}","comments_url":"https://api.github.com/repos/intel-hadoop/gearpump/comments{/number}","issue_comment_url":"https://api.github.com/repos/intel-hadoop/gearpump/issues/comments{/number}","contents_url":"https://api.github.com/repos/intel-hadoop/gearpump/contents/{+path}","compare_url":"https://api.github.com/repos/intel-hadoop/gearpump/compare/{base}...{head}","merges_url":"https://api.github.com/repos/intel-hadoop/gearpump/merges","archive_url":"https://api.github.com/repos/intel-hadoop/gearpump/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/intel-hadoop/gearpump/downloads","issues_url":"https://api.github.com/repos/intel-hadoop/gearpump/issues{/number}","pulls_url":"https://api.github.com/repos/intel-hadoop/gearpump/pulls{/number}","milestones_url":"https://api.github.com/repos/intel-hadoop/gearpump/milestones{/number}","notifications_url":"https://api.github.com/repos/intel-hadoop/gearpump/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/intel-hadoop/gearpump/labels{/name}","releases_url":"https://api.github.com/repos/intel-hadoop/gearpump/releases{/id}","created_at":"2014-07-23T08:55:26Z","updated_at":"2015-05-25T12:54:14Z","pushed_at":"2015-05-28T11:55:03Z","git_url":"git://github.com/intel-hadoop/gearpump.git","ssh_url":"git@github.com:intel-hadoop/gearpump.git","clone_url":"https://github.com/intel-hadoop/gearpump.git","svn_url":"https://github.com/intel-hadoop/gearpump","homepage":"http://gearpump.io","size":17763,"stargazers_count":266,"watchers_count":266,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":53,"mirror_url":null,"open_issues_count":84,"forks":53,"open_issues":84,"watchers":266,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/intel-hadoop/gearpump/pulls/951"},"html":{"href":"https://github.com/intel-hadoop/gearpump/pull/951"},"issue":{"href":"https://api.github.com/repos/intel-hadoop/gearpump/issues/951"},"comments":{"href":"https://api.github.com/repos/intel-hadoop/gearpump/issues/951/comments"},"review_comments":{"href":"https://api.github.com/repos/intel-hadoop/gearpump/pulls/951/comments"},"review_comment":{"href":"https://api.github.com/repos/intel-hadoop/gearpump/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/intel-hadoop/gearpump/pulls/951/commits"},"statuses":{"href":"https://api.github.com/repos/intel-hadoop/gearpump/statuses/6e0a81e21598099940aaa3e404c020fef9adce48"}}}}