{"action":"created","issue":{"url":"https://api.github.com/repos/apache/spark/issues/5428","labels_url":"https://api.github.com/repos/apache/spark/issues/5428/labels{/name}","comments_url":"https://api.github.com/repos/apache/spark/issues/5428/comments","events_url":"https://api.github.com/repos/apache/spark/issues/5428/events","html_url":"https://github.com/apache/spark/pull/5428","id":67235166,"number":5428,"title":"[SPARK-6752][Streaming] Allow StreamingContext to be recreated from checkpoint and existing SparkContext","user":{"login":"tdas","id":663212,"avatar_url":"https://avatars.githubusercontent.com/u/663212?v=3","gravatar_id":"","url":"https://api.github.com/users/tdas","html_url":"https://github.com/tdas","followers_url":"https://api.github.com/users/tdas/followers","following_url":"https://api.github.com/users/tdas/following{/other_user}","gists_url":"https://api.github.com/users/tdas/gists{/gist_id}","starred_url":"https://api.github.com/users/tdas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tdas/subscriptions","organizations_url":"https://api.github.com/users/tdas/orgs","repos_url":"https://api.github.com/users/tdas/repos","events_url":"https://api.github.com/users/tdas/events{/privacy}","received_events_url":"https://api.github.com/users/tdas/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":38,"created_at":"2015-04-08T22:35:12Z","updated_at":"2015-04-23T18:28:24Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/apache/spark/pulls/5428","html_url":"https://github.com/apache/spark/pull/5428","diff_url":"https://github.com/apache/spark/pull/5428.diff","patch_url":"https://github.com/apache/spark/pull/5428.patch"},"body":"Currently if you want to create a StreamingContext from checkpoint information, the system will create a new SparkContext. This prevent StreamingContext to be recreated from checkpoints in managed environments where SparkContext is precreated.\r\n\r\nThe solution in this PR: Introduce the following methods on StreamingContext\r\n1. `new StreamingContext(checkpointDirectory, sparkContext)`\r\n   Recreate StreamingContext from checkpoint using the provided SparkContext\r\n2. `StreamingContext.getOrCreate(checkpointDirectory, sparkContext, createFunction: SparkContext => StreamingContext)`\r\n   If checkpoint file exists, then recreate StreamingContext using the provided SparkContext (that is, call 1.), else create StreamingContext using the provided createFunction\r\n\r\nTODO: the corresponding Java and Python API has to be added as well."},"comment":{"url":"https://api.github.com/repos/apache/spark/issues/comments/95678011","html_url":"https://github.com/apache/spark/pull/5428#issuecomment-95678011","issue_url":"https://api.github.com/repos/apache/spark/issues/5428","id":95678011,"user":{"login":"tdas","id":663212,"avatar_url":"https://avatars.githubusercontent.com/u/663212?v=3","gravatar_id":"","url":"https://api.github.com/users/tdas","html_url":"https://github.com/tdas","followers_url":"https://api.github.com/users/tdas/followers","following_url":"https://api.github.com/users/tdas/following{/other_user}","gists_url":"https://api.github.com/users/tdas/gists{/gist_id}","starred_url":"https://api.github.com/users/tdas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tdas/subscriptions","organizations_url":"https://api.github.com/users/tdas/orgs","repos_url":"https://api.github.com/users/tdas/repos","events_url":"https://api.github.com/users/tdas/events{/privacy}","received_events_url":"https://api.github.com/users/tdas/received_events","type":"User","site_admin":false},"created_at":"2015-04-23T18:28:24Z","updated_at":"2015-04-23T18:28:24Z","body":"Merging this."}}