{"action":"created","comment":{"url":"https://api.github.com/repos/apache/incubator-predictionio/pulls/comments/73982644","id":73982644,"diff_hunk":"@@ -1,28 +1,54 @@\n+/*\n+ * Licensed to the Apache Software Foundation (ASF) under one or more\n+ * contributor license agreements.  See the NOTICE file distributed with\n+ * this work for additional information regarding copyright ownership.\n+ * The ASF licenses this file to You under the Apache License, Version 2.0\n+ * (the \"License\"); you may not use this file except in compliance with\n+ * 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+\n package com.test\n \n-import io.prediction.controller.PDataSource\n-import io.prediction.controller.EmptyEvaluationInfo\n-import io.prediction.controller.EmptyActualResult\n-import io.prediction.controller.Params\n-import io.prediction.data.storage.Event\n-import io.prediction.data.storage.Storage\n+import org.apache.predictionio.core.SelfCleaningDataSource\n+import org.apache.predictionio.core.EventWindow\n+\n+import org.apache.predictionio.controller.PDataSource\n+import org.apache.predictionio.controller.EmptyEvaluationInfo\n+import org.apache.predictionio.controller.EmptyActualResult\n+import org.apache.predictionio.controller.Params\n+import org.apache.predictionio.data.storage.Event\n+import org.apache.predictionio.data.storage.Storage\n \n import org.apache.spark.SparkContext\n import org.apache.spark.SparkContext._\n import org.apache.spark.rdd.RDD\n \n import grizzled.slf4j.Logger\n \n-case class DataSourceParams(appId: Int) extends Params\n+case class DataSourceParams(appName: String, eventWindow: Option[EventWindow], appId: Int) extends Params\n \n class DataSource(val dsp: DataSourceParams)\n   extends PDataSource[TrainingData,\n-      EmptyEvaluationInfo, Query, EmptyActualResult] {\n+      EmptyEvaluationInfo, Query, EmptyActualResult] with SelfCleaningDataSource {\n \n-  @transient lazy val logger = Logger[this.type]\n+  @transient override lazy val logger = Logger[this.type]\n+\n+  override def appName = dsp.appName\n+  override def eventWindow = dsp.eventWindow\n \n   override\n   def readTraining(sc: SparkContext): TrainingData = {\n+    val events = cleanPersistedPEvents(sc) \n+","path":"examples/scala-parallel-similarproduct/filterbyyear/src/main/scala/DataSource.scala","position":60,"original_position":60,"commit_id":"4b53c724eddf06de5e4f274c8017d6a905216d09","original_commit_id":"4b53c724eddf06de5e4f274c8017d6a905216d09","user":{"login":"pferrel","id":326731,"avatar_url":"https://avatars.githubusercontent.com/u/326731?v=3","gravatar_id":"","url":"https://api.github.com/users/pferrel","html_url":"https://github.com/pferrel","followers_url":"https://api.github.com/users/pferrel/followers","following_url":"https://api.github.com/users/pferrel/following{/other_user}","gists_url":"https://api.github.com/users/pferrel/gists{/gist_id}","starred_url":"https://api.github.com/users/pferrel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pferrel/subscriptions","organizations_url":"https://api.github.com/users/pferrel/orgs","repos_url":"https://api.github.com/users/pferrel/repos","events_url":"https://api.github.com/users/pferrel/events{/privacy}","received_events_url":"https://api.github.com/users/pferrel/received_events","type":"User","site_admin":false},"body":"@EmergentOrder does this still return events? Is this not built by default? Can you double check this test?","created_at":"2016-08-09T00:51:03Z","updated_at":"2016-08-09T00:51:03Z","html_url":"https://github.com/apache/incubator-predictionio/pull/269#discussion_r73982644","pull_request_url":"https://api.github.com/repos/apache/incubator-predictionio/pulls/269","_links":{"self":{"href":"https://api.github.com/repos/apache/incubator-predictionio/pulls/comments/73982644"},"html":{"href":"https://github.com/apache/incubator-predictionio/pull/269#discussion_r73982644"},"pull_request":{"href":"https://api.github.com/repos/apache/incubator-predictionio/pulls/269"}}},"pull_request":{"url":"https://api.github.com/repos/apache/incubator-predictionio/pulls/269","id":80351135,"html_url":"https://github.com/apache/incubator-predictionio/pull/269","diff_url":"https://github.com/apache/incubator-predictionio/pull/269.diff","patch_url":"https://github.com/apache/incubator-predictionio/pull/269.patch","issue_url":"https://api.github.com/repos/apache/incubator-predictionio/issues/269","number":269,"state":"open","locked":false,"title":"ActionML Master merge PR, discussion only","user":{"login":"pferrel","id":326731,"avatar_url":"https://avatars.githubusercontent.com/u/326731?v=3","gravatar_id":"","url":"https://api.github.com/users/pferrel","html_url":"https://github.com/pferrel","followers_url":"https://api.github.com/users/pferrel/followers","following_url":"https://api.github.com/users/pferrel/following{/other_user}","gists_url":"https://api.github.com/users/pferrel/gists{/gist_id}","starred_url":"https://api.github.com/users/pferrel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pferrel/subscriptions","organizations_url":"https://api.github.com/users/pferrel/orgs","repos_url":"https://api.github.com/users/pferrel/repos","events_url":"https://api.github.com/users/pferrel/events{/privacy}","received_events_url":"https://api.github.com/users/pferrel/received_events","type":"User","site_admin":false},"body":"PR for ActionML fork","created_at":"2016-08-06T21:23:17Z","updated_at":"2016-08-09T00:51:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/apache/incubator-predictionio/pulls/269/commits","review_comments_url":"https://api.github.com/repos/apache/incubator-predictionio/pulls/269/comments","review_comment_url":"https://api.github.com/repos/apache/incubator-predictionio/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/incubator-predictionio/issues/269/comments","statuses_url":"https://api.github.com/repos/apache/incubator-predictionio/statuses/4b53c724eddf06de5e4f274c8017d6a905216d09","head":{"label":"pferrel:master","ref":"master","sha":"4b53c724eddf06de5e4f274c8017d6a905216d09","user":{"login":"pferrel","id":326731,"avatar_url":"https://avatars.githubusercontent.com/u/326731?v=3","gravatar_id":"","url":"https://api.github.com/users/pferrel","html_url":"https://github.com/pferrel","followers_url":"https://api.github.com/users/pferrel/followers","following_url":"https://api.github.com/users/pferrel/following{/other_user}","gists_url":"https://api.github.com/users/pferrel/gists{/gist_id}","starred_url":"https://api.github.com/users/pferrel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pferrel/subscriptions","organizations_url":"https://api.github.com/users/pferrel/orgs","repos_url":"https://api.github.com/users/pferrel/repos","events_url":"https://api.github.com/users/pferrel/events{/privacy}","received_events_url":"https://api.github.com/users/pferrel/received_events","type":"User","site_admin":false},"repo":{"id":32399882,"name":"PredictionIO","full_name":"pferrel/PredictionIO","owner":{"login":"pferrel","id":326731,"avatar_url":"https://avatars.githubusercontent.com/u/326731?v=3","gravatar_id":"","url":"https://api.github.com/users/pferrel","html_url":"https://github.com/pferrel","followers_url":"https://api.github.com/users/pferrel/followers","following_url":"https://api.github.com/users/pferrel/following{/other_user}","gists_url":"https://api.github.com/users/pferrel/gists{/gist_id}","starred_url":"https://api.github.com/users/pferrel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pferrel/subscriptions","organizations_url":"https://api.github.com/users/pferrel/orgs","repos_url":"https://api.github.com/users/pferrel/repos","events_url":"https://api.github.com/users/pferrel/events{/privacy}","received_events_url":"https://api.github.com/users/pferrel/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/pferrel/PredictionIO","description":"PredictionIO, a machine learning server for developers and data scientists. Built on Apache Spark, HBase and Spray.","fork":true,"url":"https://api.github.com/repos/pferrel/PredictionIO","forks_url":"https://api.github.com/repos/pferrel/PredictionIO/forks","keys_url":"https://api.github.com/repos/pferrel/PredictionIO/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pferrel/PredictionIO/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pferrel/PredictionIO/teams","hooks_url":"https://api.github.com/repos/pferrel/PredictionIO/hooks","issue_events_url":"https://api.github.com/repos/pferrel/PredictionIO/issues/events{/number}","events_url":"https://api.github.com/repos/pferrel/PredictionIO/events","assignees_url":"https://api.github.com/repos/pferrel/PredictionIO/assignees{/user}","branches_url":"https://api.github.com/repos/pferrel/PredictionIO/branches{/branch}","tags_url":"https://api.github.com/repos/pferrel/PredictionIO/tags","blobs_url":"https://api.github.com/repos/pferrel/PredictionIO/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pferrel/PredictionIO/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pferrel/PredictionIO/git/refs{/sha}","trees_url":"https://api.github.com/repos/pferrel/PredictionIO/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pferrel/PredictionIO/statuses/{sha}","languages_url":"https://api.github.com/repos/pferrel/PredictionIO/languages","stargazers_url":"https://api.github.com/repos/pferrel/PredictionIO/stargazers","contributors_url":"https://api.github.com/repos/pferrel/PredictionIO/contributors","subscribers_url":"https://api.github.com/repos/pferrel/PredictionIO/subscribers","subscription_url":"https://api.github.com/repos/pferrel/PredictionIO/subscription","commits_url":"https://api.github.com/repos/pferrel/PredictionIO/commits{/sha}","git_commits_url":"https://api.github.com/repos/pferrel/PredictionIO/git/commits{/sha}","comments_url":"https://api.github.com/repos/pferrel/PredictionIO/comments{/number}","issue_comment_url":"https://api.github.com/repos/pferrel/PredictionIO/issues/comments{/number}","contents_url":"https://api.github.com/repos/pferrel/PredictionIO/contents/{+path}","compare_url":"https://api.github.com/repos/pferrel/PredictionIO/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pferrel/PredictionIO/merges","archive_url":"https://api.github.com/repos/pferrel/PredictionIO/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pferrel/PredictionIO/downloads","issues_url":"https://api.github.com/repos/pferrel/PredictionIO/issues{/number}","pulls_url":"https://api.github.com/repos/pferrel/PredictionIO/pulls{/number}","milestones_url":"https://api.github.com/repos/pferrel/PredictionIO/milestones{/number}","notifications_url":"https://api.github.com/repos/pferrel/PredictionIO/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pferrel/PredictionIO/labels{/name}","releases_url":"https://api.github.com/repos/pferrel/PredictionIO/releases{/id}","deployments_url":"https://api.github.com/repos/pferrel/PredictionIO/deployments","created_at":"2015-03-17T14:55:01Z","updated_at":"2016-06-30T19:25:57Z","pushed_at":"2016-08-07T18:48:49Z","git_url":"git://github.com/pferrel/PredictionIO.git","ssh_url":"git@github.com:pferrel/PredictionIO.git","clone_url":"https://github.com/pferrel/PredictionIO.git","svn_url":"https://github.com/pferrel/PredictionIO","homepage":"http://prediction.io/","size":28689,"stargazers_count":0,"watchers_count":0,"language":"Scala","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":"develop"}},"base":{"label":"apache:develop","ref":"develop","sha":"762908166add4893b6f355c39bda49ce8030592e","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":7827081,"name":"incubator-predictionio","full_name":"apache/incubator-predictionio","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/incubator-predictionio","description":"PredictionIO, a machine learning server for developers and ML engineers. Built on Apache Spark, HBase and Spray.","fork":false,"url":"https://api.github.com/repos/apache/incubator-predictionio","forks_url":"https://api.github.com/repos/apache/incubator-predictionio/forks","keys_url":"https://api.github.com/repos/apache/incubator-predictionio/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/incubator-predictionio/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/incubator-predictionio/teams","hooks_url":"https://api.github.com/repos/apache/incubator-predictionio/hooks","issue_events_url":"https://api.github.com/repos/apache/incubator-predictionio/issues/events{/number}","events_url":"https://api.github.com/repos/apache/incubator-predictionio/events","assignees_url":"https://api.github.com/repos/apache/incubator-predictionio/assignees{/user}","branches_url":"https://api.github.com/repos/apache/incubator-predictionio/branches{/branch}","tags_url":"https://api.github.com/repos/apache/incubator-predictionio/tags","blobs_url":"https://api.github.com/repos/apache/incubator-predictionio/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/incubator-predictionio/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/incubator-predictionio/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/incubator-predictionio/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/incubator-predictionio/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/incubator-predictionio/languages","stargazers_url":"https://api.github.com/repos/apache/incubator-predictionio/stargazers","contributors_url":"https://api.github.com/repos/apache/incubator-predictionio/contributors","subscribers_url":"https://api.github.com/repos/apache/incubator-predictionio/subscribers","subscription_url":"https://api.github.com/repos/apache/incubator-predictionio/subscription","commits_url":"https://api.github.com/repos/apache/incubator-predictionio/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/incubator-predictionio/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/incubator-predictionio/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/incubator-predictionio/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/incubator-predictionio/contents/{+path}","compare_url":"https://api.github.com/repos/apache/incubator-predictionio/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/incubator-predictionio/merges","archive_url":"https://api.github.com/repos/apache/incubator-predictionio/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/incubator-predictionio/downloads","issues_url":"https://api.github.com/repos/apache/incubator-predictionio/issues{/number}","pulls_url":"https://api.github.com/repos/apache/incubator-predictionio/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/incubator-predictionio/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/incubator-predictionio/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/incubator-predictionio/labels{/name}","releases_url":"https://api.github.com/repos/apache/incubator-predictionio/releases{/id}","deployments_url":"https://api.github.com/repos/apache/incubator-predictionio/deployments","created_at":"2013-01-25T19:42:32Z","updated_at":"2016-08-09T00:06:21Z","pushed_at":"2016-08-09T00:03:11Z","git_url":"git://github.com/apache/incubator-predictionio.git","ssh_url":"git@github.com:apache/incubator-predictionio.git","clone_url":"https://github.com/apache/incubator-predictionio.git","svn_url":"https://github.com/apache/incubator-predictionio","homepage":"http://prediction.io/","size":34828,"stargazers_count":9473,"watchers_count":9473,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1434,"mirror_url":null,"open_issues_count":40,"forks":1434,"open_issues":40,"watchers":9473,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/incubator-predictionio/pulls/269"},"html":{"href":"https://github.com/apache/incubator-predictionio/pull/269"},"issue":{"href":"https://api.github.com/repos/apache/incubator-predictionio/issues/269"},"comments":{"href":"https://api.github.com/repos/apache/incubator-predictionio/issues/269/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/incubator-predictionio/pulls/269/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/incubator-predictionio/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/incubator-predictionio/pulls/269/commits"},"statuses":{"href":"https://api.github.com/repos/apache/incubator-predictionio/statuses/4b53c724eddf06de5e4f274c8017d6a905216d09"}}}}
{"actor":{"display_login":"pferrel"}}