{"action":"created","comment":{"url":"https://api.github.com/repos/druid-io/druid/pulls/comments/37828608","id":37828608,"diff_hunk":"@@ -0,0 +1,122 @@\n+/*\n+* Licensed to Metamarkets Group Inc. (Metamarkets) under one\n+* or more contributor license agreements. See the NOTICE file\n+* distributed with this work for additional information\n+* regarding copyright ownership. Metamarkets 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,\n+* software distributed under the License is distributed on an\n+* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n+* KIND, either express or implied. See the License for the\n+* specific language governing permissions and limitations\n+* under the License.\n+*/\n+\n+package io.druid.storage.hdfs;\n+\n+import com.google.common.collect.ImmutableList;\n+import com.google.common.collect.ImmutableMap;\n+import io.druid.timeline.DataSegment;\n+import io.druid.timeline.partition.NoneShardSpec;\n+import org.apache.hadoop.conf.Configuration;\n+import org.apache.hadoop.fs.FSDataOutputStream;\n+import org.apache.hadoop.fs.FileSystem;\n+import org.apache.hadoop.fs.Path;\n+import org.joda.time.Interval;\n+import org.junit.Assert;\n+import org.junit.Test;\n+\n+import java.io.IOException;\n+\n+/**\n+ */\n+public class HdfsDataSegmentKillerTest\n+{\n+  @Test\n+  public void testKill() throws Exception\n+  {\n+    Configuration config = new Configuration();\n+    HdfsDataSegmentKiller killer = new HdfsDataSegmentKiller(config);\n+\n+    FileSystem fs = FileSystem.get(config);\n+\n+    // Create following segments and then delete them in this order and assert directory deletions","path":"extensions/hdfs-storage/src/test/java/io/druid/storage/hdfs/HdfsDataSegmentKillerTest.java","position":48,"original_position":48,"commit_id":"5b5a76ef6cca2ab88768470624469060f53f1a58","original_commit_id":"5b5a76ef6cca2ab88768470624469060f53f1a58","user":{"login":"himanshug","id":246308,"avatar_url":"https://avatars.githubusercontent.com/u/246308?v=3","gravatar_id":"","url":"https://api.github.com/users/himanshug","html_url":"https://github.com/himanshug","followers_url":"https://api.github.com/users/himanshug/followers","following_url":"https://api.github.com/users/himanshug/following{/other_user}","gists_url":"https://api.github.com/users/himanshug/gists{/gist_id}","starred_url":"https://api.github.com/users/himanshug/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/himanshug/subscriptions","organizations_url":"https://api.github.com/users/himanshug/orgs","repos_url":"https://api.github.com/users/himanshug/repos","events_url":"https://api.github.com/users/himanshug/events{/privacy}","received_events_url":"https://api.github.com/users/himanshug/received_events","type":"User","site_admin":false},"body":"do you mean, remove this comment? I thought it was useful to explain what test was doing.","created_at":"2015-08-25T03:04:57Z","updated_at":"2015-08-25T03:04:57Z","html_url":"https://github.com/druid-io/druid/pull/1659#discussion_r37828608","pull_request_url":"https://api.github.com/repos/druid-io/druid/pulls/1659","_links":{"self":{"href":"https://api.github.com/repos/druid-io/druid/pulls/comments/37828608"},"html":{"href":"https://github.com/druid-io/druid/pull/1659#discussion_r37828608"},"pull_request":{"href":"https://api.github.com/repos/druid-io/druid/pulls/1659"}}},"pull_request":{"url":"https://api.github.com/repos/druid-io/druid/pulls/1659","id":43136510,"html_url":"https://github.com/druid-io/druid/pull/1659","diff_url":"https://github.com/druid-io/druid/pull/1659.diff","patch_url":"https://github.com/druid-io/druid/pull/1659.patch","issue_url":"https://api.github.com/repos/druid-io/druid/issues/1659","number":1659,"state":"open","locked":false,"title":"on kill segment, dont leave version, interval and dataSource dir behind on HDFS","user":{"login":"himanshug","id":246308,"avatar_url":"https://avatars.githubusercontent.com/u/246308?v=3","gravatar_id":"","url":"https://api.github.com/users/himanshug","html_url":"https://github.com/himanshug","followers_url":"https://api.github.com/users/himanshug/followers","following_url":"https://api.github.com/users/himanshug/following{/other_user}","gists_url":"https://api.github.com/users/himanshug/gists{/gist_id}","starred_url":"https://api.github.com/users/himanshug/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/himanshug/subscriptions","organizations_url":"https://api.github.com/users/himanshug/orgs","repos_url":"https://api.github.com/users/himanshug/repos","events_url":"https://api.github.com/users/himanshug/events{/privacy}","received_events_url":"https://api.github.com/users/himanshug/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-08-24T03:09:08Z","updated_at":"2015-08-25T03:04:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9756d9db58b18464518a02b115d4ae5ee334f215","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/druid-io/druid/pulls/1659/commits","review_comments_url":"https://api.github.com/repos/druid-io/druid/pulls/1659/comments","review_comment_url":"https://api.github.com/repos/druid-io/druid/pulls/comments{/number}","comments_url":"https://api.github.com/repos/druid-io/druid/issues/1659/comments","statuses_url":"https://api.github.com/repos/druid-io/druid/statuses/5b5a76ef6cca2ab88768470624469060f53f1a58","head":{"label":"himanshug:segment_kill_update","ref":"segment_kill_update","sha":"5b5a76ef6cca2ab88768470624469060f53f1a58","user":{"login":"himanshug","id":246308,"avatar_url":"https://avatars.githubusercontent.com/u/246308?v=3","gravatar_id":"","url":"https://api.github.com/users/himanshug","html_url":"https://github.com/himanshug","followers_url":"https://api.github.com/users/himanshug/followers","following_url":"https://api.github.com/users/himanshug/following{/other_user}","gists_url":"https://api.github.com/users/himanshug/gists{/gist_id}","starred_url":"https://api.github.com/users/himanshug/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/himanshug/subscriptions","organizations_url":"https://api.github.com/users/himanshug/orgs","repos_url":"https://api.github.com/users/himanshug/repos","events_url":"https://api.github.com/users/himanshug/events{/privacy}","received_events_url":"https://api.github.com/users/himanshug/received_events","type":"User","site_admin":false},"repo":{"id":23076411,"name":"druid","full_name":"himanshug/druid","owner":{"login":"himanshug","id":246308,"avatar_url":"https://avatars.githubusercontent.com/u/246308?v=3","gravatar_id":"","url":"https://api.github.com/users/himanshug","html_url":"https://github.com/himanshug","followers_url":"https://api.github.com/users/himanshug/followers","following_url":"https://api.github.com/users/himanshug/following{/other_user}","gists_url":"https://api.github.com/users/himanshug/gists{/gist_id}","starred_url":"https://api.github.com/users/himanshug/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/himanshug/subscriptions","organizations_url":"https://api.github.com/users/himanshug/orgs","repos_url":"https://api.github.com/users/himanshug/repos","events_url":"https://api.github.com/users/himanshug/events{/privacy}","received_events_url":"https://api.github.com/users/himanshug/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/himanshug/druid","description":"Real²time Exploratory Analytics on Large Datasets","fork":true,"url":"https://api.github.com/repos/himanshug/druid","forks_url":"https://api.github.com/repos/himanshug/druid/forks","keys_url":"https://api.github.com/repos/himanshug/druid/keys{/key_id}","collaborators_url":"https://api.github.com/repos/himanshug/druid/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/himanshug/druid/teams","hooks_url":"https://api.github.com/repos/himanshug/druid/hooks","issue_events_url":"https://api.github.com/repos/himanshug/druid/issues/events{/number}","events_url":"https://api.github.com/repos/himanshug/druid/events","assignees_url":"https://api.github.com/repos/himanshug/druid/assignees{/user}","branches_url":"https://api.github.com/repos/himanshug/druid/branches{/branch}","tags_url":"https://api.github.com/repos/himanshug/druid/tags","blobs_url":"https://api.github.com/repos/himanshug/druid/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/himanshug/druid/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/himanshug/druid/git/refs{/sha}","trees_url":"https://api.github.com/repos/himanshug/druid/git/trees{/sha}","statuses_url":"https://api.github.com/repos/himanshug/druid/statuses/{sha}","languages_url":"https://api.github.com/repos/himanshug/druid/languages","stargazers_url":"https://api.github.com/repos/himanshug/druid/stargazers","contributors_url":"https://api.github.com/repos/himanshug/druid/contributors","subscribers_url":"https://api.github.com/repos/himanshug/druid/subscribers","subscription_url":"https://api.github.com/repos/himanshug/druid/subscription","commits_url":"https://api.github.com/repos/himanshug/druid/commits{/sha}","git_commits_url":"https://api.github.com/repos/himanshug/druid/git/commits{/sha}","comments_url":"https://api.github.com/repos/himanshug/druid/comments{/number}","issue_comment_url":"https://api.github.com/repos/himanshug/druid/issues/comments{/number}","contents_url":"https://api.github.com/repos/himanshug/druid/contents/{+path}","compare_url":"https://api.github.com/repos/himanshug/druid/compare/{base}...{head}","merges_url":"https://api.github.com/repos/himanshug/druid/merges","archive_url":"https://api.github.com/repos/himanshug/druid/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/himanshug/druid/downloads","issues_url":"https://api.github.com/repos/himanshug/druid/issues{/number}","pulls_url":"https://api.github.com/repos/himanshug/druid/pulls{/number}","milestones_url":"https://api.github.com/repos/himanshug/druid/milestones{/number}","notifications_url":"https://api.github.com/repos/himanshug/druid/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/himanshug/druid/labels{/name}","releases_url":"https://api.github.com/repos/himanshug/druid/releases{/id}","created_at":"2014-08-18T15:28:53Z","updated_at":"2015-02-23T20:08:38Z","pushed_at":"2015-08-24T15:47:32Z","git_url":"git://github.com/himanshug/druid.git","ssh_url":"git@github.com:himanshug/druid.git","clone_url":"https://github.com/himanshug/druid.git","svn_url":"https://github.com/himanshug/druid","homepage":"http://druid.io","size":94598,"stargazers_count":0,"watchers_count":0,"language":"Java","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":"druid-io:master","ref":"master","sha":"0c11097b4f067387a4a01bace3cf76f67e7704dd","user":{"login":"druid-io","id":4203474,"avatar_url":"https://avatars.githubusercontent.com/u/4203474?v=3","gravatar_id":"","url":"https://api.github.com/users/druid-io","html_url":"https://github.com/druid-io","followers_url":"https://api.github.com/users/druid-io/followers","following_url":"https://api.github.com/users/druid-io/following{/other_user}","gists_url":"https://api.github.com/users/druid-io/gists{/gist_id}","starred_url":"https://api.github.com/users/druid-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/druid-io/subscriptions","organizations_url":"https://api.github.com/users/druid-io/orgs","repos_url":"https://api.github.com/users/druid-io/repos","events_url":"https://api.github.com/users/druid-io/events{/privacy}","received_events_url":"https://api.github.com/users/druid-io/received_events","type":"Organization","site_admin":false},"repo":{"id":6358188,"name":"druid","full_name":"druid-io/druid","owner":{"login":"druid-io","id":4203474,"avatar_url":"https://avatars.githubusercontent.com/u/4203474?v=3","gravatar_id":"","url":"https://api.github.com/users/druid-io","html_url":"https://github.com/druid-io","followers_url":"https://api.github.com/users/druid-io/followers","following_url":"https://api.github.com/users/druid-io/following{/other_user}","gists_url":"https://api.github.com/users/druid-io/gists{/gist_id}","starred_url":"https://api.github.com/users/druid-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/druid-io/subscriptions","organizations_url":"https://api.github.com/users/druid-io/orgs","repos_url":"https://api.github.com/users/druid-io/repos","events_url":"https://api.github.com/users/druid-io/events{/privacy}","received_events_url":"https://api.github.com/users/druid-io/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/druid-io/druid","description":"Column oriented distributed data store ideal for powering interactive applications","fork":false,"url":"https://api.github.com/repos/druid-io/druid","forks_url":"https://api.github.com/repos/druid-io/druid/forks","keys_url":"https://api.github.com/repos/druid-io/druid/keys{/key_id}","collaborators_url":"https://api.github.com/repos/druid-io/druid/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/druid-io/druid/teams","hooks_url":"https://api.github.com/repos/druid-io/druid/hooks","issue_events_url":"https://api.github.com/repos/druid-io/druid/issues/events{/number}","events_url":"https://api.github.com/repos/druid-io/druid/events","assignees_url":"https://api.github.com/repos/druid-io/druid/assignees{/user}","branches_url":"https://api.github.com/repos/druid-io/druid/branches{/branch}","tags_url":"https://api.github.com/repos/druid-io/druid/tags","blobs_url":"https://api.github.com/repos/druid-io/druid/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/druid-io/druid/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/druid-io/druid/git/refs{/sha}","trees_url":"https://api.github.com/repos/druid-io/druid/git/trees{/sha}","statuses_url":"https://api.github.com/repos/druid-io/druid/statuses/{sha}","languages_url":"https://api.github.com/repos/druid-io/druid/languages","stargazers_url":"https://api.github.com/repos/druid-io/druid/stargazers","contributors_url":"https://api.github.com/repos/druid-io/druid/contributors","subscribers_url":"https://api.github.com/repos/druid-io/druid/subscribers","subscription_url":"https://api.github.com/repos/druid-io/druid/subscription","commits_url":"https://api.github.com/repos/druid-io/druid/commits{/sha}","git_commits_url":"https://api.github.com/repos/druid-io/druid/git/commits{/sha}","comments_url":"https://api.github.com/repos/druid-io/druid/comments{/number}","issue_comment_url":"https://api.github.com/repos/druid-io/druid/issues/comments{/number}","contents_url":"https://api.github.com/repos/druid-io/druid/contents/{+path}","compare_url":"https://api.github.com/repos/druid-io/druid/compare/{base}...{head}","merges_url":"https://api.github.com/repos/druid-io/druid/merges","archive_url":"https://api.github.com/repos/druid-io/druid/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/druid-io/druid/downloads","issues_url":"https://api.github.com/repos/druid-io/druid/issues{/number}","pulls_url":"https://api.github.com/repos/druid-io/druid/pulls{/number}","milestones_url":"https://api.github.com/repos/druid-io/druid/milestones{/number}","notifications_url":"https://api.github.com/repos/druid-io/druid/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/druid-io/druid/labels{/name}","releases_url":"https://api.github.com/repos/druid-io/druid/releases{/id}","created_at":"2012-10-23T19:08:07Z","updated_at":"2015-08-24T09:37:46Z","pushed_at":"2015-08-25T02:50:42Z","git_url":"git://github.com/druid-io/druid.git","ssh_url":"git@github.com:druid-io/druid.git","clone_url":"https://github.com/druid-io/druid.git","svn_url":"https://github.com/druid-io/druid","homepage":"http://druid.io","size":175580,"stargazers_count":1951,"watchers_count":1951,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":438,"mirror_url":null,"open_issues_count":168,"forks":438,"open_issues":168,"watchers":1951,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/druid-io/druid/pulls/1659"},"html":{"href":"https://github.com/druid-io/druid/pull/1659"},"issue":{"href":"https://api.github.com/repos/druid-io/druid/issues/1659"},"comments":{"href":"https://api.github.com/repos/druid-io/druid/issues/1659/comments"},"review_comments":{"href":"https://api.github.com/repos/druid-io/druid/pulls/1659/comments"},"review_comment":{"href":"https://api.github.com/repos/druid-io/druid/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/druid-io/druid/pulls/1659/commits"},"statuses":{"href":"https://api.github.com/repos/druid-io/druid/statuses/5b5a76ef6cca2ab88768470624469060f53f1a58"}}}}