{"action":"created","comment":{"url":"https://api.github.com/repos/apache/spark/pulls/comments/347824500","pull_request_review_id":318903765,"id":347824500,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDM0NzgyNDUwMA==","diff_hunk":"@@ -342,7 +344,14 @@ object FileStreamSource {\n     def size: Int = map.size()\n   }\n \n-  private[sql] trait FileStreamSourceCleaner {\n+  private[sql] abstract class FileStreamSourceCleaner {\n+    protected val cleanThreadPool = ThreadUtils.newDaemonCachedThreadPool(\n+      \"file-source-cleaner-threadpool\",\n+      SQLConf.get.getConf(SQLConf.FILE_SOURCE_CLEANER_NUM_THREADS)\n+    )\n+\n+    def stop(): Unit = cleanThreadPool.shutdown()","path":"sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/FileStreamSource.scala","position":30,"original_position":30,"commit_id":"7f14b55207e87323df3765c849621ce1205f5240","original_commit_id":"7f14b55207e87323df3765c849621ce1205f5240","user":{"login":"gaborgsomogyi","id":18561820,"node_id":"MDQ6VXNlcjE4NTYxODIw","avatar_url":"https://avatars2.githubusercontent.com/u/18561820?v=4","gravatar_id":"","url":"https://api.github.com/users/gaborgsomogyi","html_url":"https://github.com/gaborgsomogyi","followers_url":"https://api.github.com/users/gaborgsomogyi/followers","following_url":"https://api.github.com/users/gaborgsomogyi/following{/other_user}","gists_url":"https://api.github.com/users/gaborgsomogyi/gists{/gist_id}","starred_url":"https://api.github.com/users/gaborgsomogyi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gaborgsomogyi/subscriptions","organizations_url":"https://api.github.com/users/gaborgsomogyi/orgs","repos_url":"https://api.github.com/users/gaborgsomogyi/repos","events_url":"https://api.github.com/users/gaborgsomogyi/events{/privacy}","received_events_url":"https://api.github.com/users/gaborgsomogyi/received_events","type":"User","site_admin":false},"body":"OK, then adding `awaitTermination` as we've agreed on it.","created_at":"2019-11-19T09:50:59Z","updated_at":"2019-11-19T09:51:00Z","html_url":"https://github.com/apache/spark/pull/26502#discussion_r347824500","pull_request_url":"https://api.github.com/repos/apache/spark/pulls/26502","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/apache/spark/pulls/comments/347824500"},"html":{"href":"https://github.com/apache/spark/pull/26502#discussion_r347824500"},"pull_request":{"href":"https://api.github.com/repos/apache/spark/pulls/26502"}},"in_reply_to_id":346051087},"pull_request":{"url":"https://api.github.com/repos/apache/spark/pulls/26502","id":340375596,"node_id":"MDExOlB1bGxSZXF1ZXN0MzQwMzc1NTk2","html_url":"https://github.com/apache/spark/pull/26502","diff_url":"https://github.com/apache/spark/pull/26502.diff","patch_url":"https://github.com/apache/spark/pull/26502.patch","issue_url":"https://api.github.com/repos/apache/spark/issues/26502","number":26502,"state":"open","locked":false,"title":"[SPARK-29876][SS] Delete/archive file source completed files in separate thread","user":{"login":"gaborgsomogyi","id":18561820,"node_id":"MDQ6VXNlcjE4NTYxODIw","avatar_url":"https://avatars2.githubusercontent.com/u/18561820?v=4","gravatar_id":"","url":"https://api.github.com/users/gaborgsomogyi","html_url":"https://github.com/gaborgsomogyi","followers_url":"https://api.github.com/users/gaborgsomogyi/followers","following_url":"https://api.github.com/users/gaborgsomogyi/following{/other_user}","gists_url":"https://api.github.com/users/gaborgsomogyi/gists{/gist_id}","starred_url":"https://api.github.com/users/gaborgsomogyi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gaborgsomogyi/subscriptions","organizations_url":"https://api.github.com/users/gaborgsomogyi/orgs","repos_url":"https://api.github.com/users/gaborgsomogyi/repos","events_url":"https://api.github.com/users/gaborgsomogyi/events{/privacy}","received_events_url":"https://api.github.com/users/gaborgsomogyi/received_events","type":"User","site_admin":false},"body":"### What changes were proposed in this pull request?\r\n[SPARK-20568](https://issues.apache.org/jira/browse/SPARK-20568) added the possibility to clean up completed files in streaming query. Deleting/archiving uses the main thread which can slow down processing. In this PR I've created thread pool to handle file delete/archival. The number of threads can be configured with `spark.sql.streaming.fileSource.cleaner.numThreads`.\r\n\r\n### Why are the changes needed?\r\nDo file delete/archival in separate thread.\r\n\r\n### Does this PR introduce any user-facing change?\r\nNo.\r\n\r\n### How was this patch tested?\r\nExisting unit tests.\r\n","created_at":"2019-11-13T10:49:36Z","updated_at":"2019-11-19T09:51:00Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ab786c20de9f8f4ce890088cf987913afeeaf651","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":1406587328,"node_id":"MDU6TGFiZWwxNDA2NTg3MzI4","url":"https://api.github.com/repos/apache/spark/labels/STRUCTURED%20STREAMING","name":"STRUCTURED STREAMING","color":"ededed","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/apache/spark/pulls/26502/commits","review_comments_url":"https://api.github.com/repos/apache/spark/pulls/26502/comments","review_comment_url":"https://api.github.com/repos/apache/spark/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/spark/issues/26502/comments","statuses_url":"https://api.github.com/repos/apache/spark/statuses/7f14b55207e87323df3765c849621ce1205f5240","head":{"label":"gaborgsomogyi:SPARK-29876","ref":"SPARK-29876","sha":"7f14b55207e87323df3765c849621ce1205f5240","user":{"login":"gaborgsomogyi","id":18561820,"node_id":"MDQ6VXNlcjE4NTYxODIw","avatar_url":"https://avatars2.githubusercontent.com/u/18561820?v=4","gravatar_id":"","url":"https://api.github.com/users/gaborgsomogyi","html_url":"https://github.com/gaborgsomogyi","followers_url":"https://api.github.com/users/gaborgsomogyi/followers","following_url":"https://api.github.com/users/gaborgsomogyi/following{/other_user}","gists_url":"https://api.github.com/users/gaborgsomogyi/gists{/gist_id}","starred_url":"https://api.github.com/users/gaborgsomogyi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gaborgsomogyi/subscriptions","organizations_url":"https://api.github.com/users/gaborgsomogyi/orgs","repos_url":"https://api.github.com/users/gaborgsomogyi/repos","events_url":"https://api.github.com/users/gaborgsomogyi/events{/privacy}","received_events_url":"https://api.github.com/users/gaborgsomogyi/received_events","type":"User","site_admin":false},"repo":{"id":111547097,"node_id":"MDEwOlJlcG9zaXRvcnkxMTE1NDcwOTc=","name":"spark","full_name":"gaborgsomogyi/spark","private":false,"owner":{"login":"gaborgsomogyi","id":18561820,"node_id":"MDQ6VXNlcjE4NTYxODIw","avatar_url":"https://avatars2.githubusercontent.com/u/18561820?v=4","gravatar_id":"","url":"https://api.github.com/users/gaborgsomogyi","html_url":"https://github.com/gaborgsomogyi","followers_url":"https://api.github.com/users/gaborgsomogyi/followers","following_url":"https://api.github.com/users/gaborgsomogyi/following{/other_user}","gists_url":"https://api.github.com/users/gaborgsomogyi/gists{/gist_id}","starred_url":"https://api.github.com/users/gaborgsomogyi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gaborgsomogyi/subscriptions","organizations_url":"https://api.github.com/users/gaborgsomogyi/orgs","repos_url":"https://api.github.com/users/gaborgsomogyi/repos","events_url":"https://api.github.com/users/gaborgsomogyi/events{/privacy}","received_events_url":"https://api.github.com/users/gaborgsomogyi/received_events","type":"User","site_admin":false},"html_url":"https://github.com/gaborgsomogyi/spark","description":"Mirror of Apache Spark","fork":true,"url":"https://api.github.com/repos/gaborgsomogyi/spark","forks_url":"https://api.github.com/repos/gaborgsomogyi/spark/forks","keys_url":"https://api.github.com/repos/gaborgsomogyi/spark/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gaborgsomogyi/spark/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gaborgsomogyi/spark/teams","hooks_url":"https://api.github.com/repos/gaborgsomogyi/spark/hooks","issue_events_url":"https://api.github.com/repos/gaborgsomogyi/spark/issues/events{/number}","events_url":"https://api.github.com/repos/gaborgsomogyi/spark/events","assignees_url":"https://api.github.com/repos/gaborgsomogyi/spark/assignees{/user}","branches_url":"https://api.github.com/repos/gaborgsomogyi/spark/branches{/branch}","tags_url":"https://api.github.com/repos/gaborgsomogyi/spark/tags","blobs_url":"https://api.github.com/repos/gaborgsomogyi/spark/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gaborgsomogyi/spark/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gaborgsomogyi/spark/git/refs{/sha}","trees_url":"https://api.github.com/repos/gaborgsomogyi/spark/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gaborgsomogyi/spark/statuses/{sha}","languages_url":"https://api.github.com/repos/gaborgsomogyi/spark/languages","stargazers_url":"https://api.github.com/repos/gaborgsomogyi/spark/stargazers","contributors_url":"https://api.github.com/repos/gaborgsomogyi/spark/contributors","subscribers_url":"https://api.github.com/repos/gaborgsomogyi/spark/subscribers","subscription_url":"https://api.github.com/repos/gaborgsomogyi/spark/subscription","commits_url":"https://api.github.com/repos/gaborgsomogyi/spark/commits{/sha}","git_commits_url":"https://api.github.com/repos/gaborgsomogyi/spark/git/commits{/sha}","comments_url":"https://api.github.com/repos/gaborgsomogyi/spark/comments{/number}","issue_comment_url":"https://api.github.com/repos/gaborgsomogyi/spark/issues/comments{/number}","contents_url":"https://api.github.com/repos/gaborgsomogyi/spark/contents/{+path}","compare_url":"https://api.github.com/repos/gaborgsomogyi/spark/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gaborgsomogyi/spark/merges","archive_url":"https://api.github.com/repos/gaborgsomogyi/spark/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gaborgsomogyi/spark/downloads","issues_url":"https://api.github.com/repos/gaborgsomogyi/spark/issues{/number}","pulls_url":"https://api.github.com/repos/gaborgsomogyi/spark/pulls{/number}","milestones_url":"https://api.github.com/repos/gaborgsomogyi/spark/milestones{/number}","notifications_url":"https://api.github.com/repos/gaborgsomogyi/spark/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gaborgsomogyi/spark/labels{/name}","releases_url":"https://api.github.com/repos/gaborgsomogyi/spark/releases{/id}","deployments_url":"https://api.github.com/repos/gaborgsomogyi/spark/deployments","created_at":"2017-11-21T12:38:03Z","updated_at":"2019-11-13T10:26:53Z","pushed_at":"2019-11-13T12:34:30Z","git_url":"git://github.com/gaborgsomogyi/spark.git","ssh_url":"git@github.com:gaborgsomogyi/spark.git","clone_url":"https://github.com/gaborgsomogyi/spark.git","svn_url":"https://github.com/gaborgsomogyi/spark","homepage":null,"size":310821,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"apache:master","ref":"master","sha":"b5a2ed6a37fd8f6630a7b22791a07a45f5aeb556","user":{"login":"apache","id":47359,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ3MzU5","avatar_url":"https://avatars0.githubusercontent.com/u/47359?v=4","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":17165658,"node_id":"MDEwOlJlcG9zaXRvcnkxNzE2NTY1OA==","name":"spark","full_name":"apache/spark","private":false,"owner":{"login":"apache","id":47359,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ3MzU5","avatar_url":"https://avatars0.githubusercontent.com/u/47359?v=4","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},"html_url":"https://github.com/apache/spark","description":"Apache Spark","fork":false,"url":"https://api.github.com/repos/apache/spark","forks_url":"https://api.github.com/repos/apache/spark/forks","keys_url":"https://api.github.com/repos/apache/spark/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/spark/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/spark/teams","hooks_url":"https://api.github.com/repos/apache/spark/hooks","issue_events_url":"https://api.github.com/repos/apache/spark/issues/events{/number}","events_url":"https://api.github.com/repos/apache/spark/events","assignees_url":"https://api.github.com/repos/apache/spark/assignees{/user}","branches_url":"https://api.github.com/repos/apache/spark/branches{/branch}","tags_url":"https://api.github.com/repos/apache/spark/tags","blobs_url":"https://api.github.com/repos/apache/spark/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/spark/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/spark/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/spark/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/spark/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/spark/languages","stargazers_url":"https://api.github.com/repos/apache/spark/stargazers","contributors_url":"https://api.github.com/repos/apache/spark/contributors","subscribers_url":"https://api.github.com/repos/apache/spark/subscribers","subscription_url":"https://api.github.com/repos/apache/spark/subscription","commits_url":"https://api.github.com/repos/apache/spark/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/spark/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/spark/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/spark/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/spark/contents/{+path}","compare_url":"https://api.github.com/repos/apache/spark/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/spark/merges","archive_url":"https://api.github.com/repos/apache/spark/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/spark/downloads","issues_url":"https://api.github.com/repos/apache/spark/issues{/number}","pulls_url":"https://api.github.com/repos/apache/spark/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/spark/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/spark/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/spark/labels{/name}","releases_url":"https://api.github.com/repos/apache/spark/releases{/id}","deployments_url":"https://api.github.com/repos/apache/spark/deployments","created_at":"2014-02-25T08:00:08Z","updated_at":"2019-11-19T09:13:01Z","pushed_at":"2019-11-19T09:37:18Z","git_url":"git://github.com/apache/spark.git","ssh_url":"git@github.com:apache/spark.git","clone_url":"https://github.com/apache/spark.git","svn_url":"https://github.com/apache/spark","homepage":"","size":318682,"stargazers_count":24277,"watchers_count":24277,"language":"Scala","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":20560,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":496,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":20560,"open_issues":496,"watchers":24277,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/spark/pulls/26502"},"html":{"href":"https://github.com/apache/spark/pull/26502"},"issue":{"href":"https://api.github.com/repos/apache/spark/issues/26502"},"comments":{"href":"https://api.github.com/repos/apache/spark/issues/26502/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/spark/pulls/26502/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/spark/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/spark/pulls/26502/commits"},"statuses":{"href":"https://api.github.com/repos/apache/spark/statuses/7f14b55207e87323df3765c849621ce1205f5240"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"gaborgsomogyi"}}