{"action":"created","comment":{"url":"https://api.github.com/repos/joey/flume/pulls/comments/23474978","id":23474978,"diff_hunk":"@@ -219,52 +249,47 @@ public synchronized void stop() {\n   @Override\n   public Status process() throws EventDeliveryException {\n     if (writer == null) {\n-      try {\n-        this.writer = newWriter(login, target);\n-      } catch (DatasetException e) {\n-        // DatasetException includes DatasetNotFoundException\n-        throw new EventDeliveryException(\n-          \"Cannot write to \" + getName(), e);\n-      }\n+      this.writer = newWriter();\n     }\n \n-    // handle file rolling\n-    if ((System.currentTimeMillis() - lastRolledMs) / 1000 > rollIntervalS) {\n-      // close the current writer and get a new one\n-      writer.close();\n-      this.writer = newWriter(login, target);\n-      this.lastRolledMs = System.currentTimeMillis();\n-      LOG.info(\"Rolled writer for \" + getName());\n+    if (shouldRoll()) {\n+      rollWriter(true, true);\n     }\n \n     Channel channel = getChannel();\n-    Transaction transaction = null;\n     try {\n       long processedEvents = 0;\n \n-      transaction = channel.getTransaction();\n-      transaction.begin();\n+      // TODO: Can the same Sink object be called from multiple threads\n+      if (transaction == null) {\n+        transaction = channel.getTransaction();","path":"flume-ng-sinks/flume-dataset-sink/src/main/java/org/apache/flume/sink/kite/DatasetSink.java","position":397,"original_position":397,"commit_id":"c2705578455e849f7f4ce4dc8117bf1bccbbcf32","original_commit_id":"c2705578455e849f7f4ce4dc8117bf1bccbbcf32","user":{"login":"joey","id":249392,"avatar_url":"https://avatars.githubusercontent.com/u/249392?v=3","gravatar_id":"","url":"https://api.github.com/users/joey","html_url":"https://github.com/joey","followers_url":"https://api.github.com/users/joey/followers","following_url":"https://api.github.com/users/joey/following{/other_user}","gists_url":"https://api.github.com/users/joey/gists{/gist_id}","starred_url":"https://api.github.com/users/joey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joey/subscriptions","organizations_url":"https://api.github.com/users/joey/orgs","repos_url":"https://api.github.com/users/joey/repos","events_url":"https://api.github.com/users/joey/events{/privacy}","received_events_url":"https://api.github.com/users/joey/received_events","type":"User","site_admin":false},"body":"Done.","created_at":"2015-01-23T19:49:09Z","updated_at":"2015-01-23T19:49:09Z","html_url":"https://github.com/joey/flume/pull/1#discussion_r23474978","pull_request_url":"https://api.github.com/repos/joey/flume/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/joey/flume/pulls/comments/23474978"},"html":{"href":"https://github.com/joey/flume/pull/1#discussion_r23474978"},"pull_request":{"href":"https://api.github.com/repos/joey/flume/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/joey/flume/pulls/1","id":27947209,"html_url":"https://github.com/joey/flume/pull/1","diff_url":"https://github.com/joey/flume/pull/1.diff","patch_url":"https://github.com/joey/flume/pull/1.patch","issue_url":"https://api.github.com/repos/joey/flume/issues/1","number":1,"state":"open","locked":false,"title":"Flume 2591 datasetsink 2.0","user":{"login":"joey","id":249392,"avatar_url":"https://avatars.githubusercontent.com/u/249392?v=3","gravatar_id":"","url":"https://api.github.com/users/joey","html_url":"https://github.com/joey","followers_url":"https://api.github.com/users/joey/followers","following_url":"https://api.github.com/users/joey/following{/other_user}","gists_url":"https://api.github.com/users/joey/gists{/gist_id}","starred_url":"https://api.github.com/users/joey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joey/subscriptions","organizations_url":"https://api.github.com/users/joey/orgs","repos_url":"https://api.github.com/users/joey/repos","events_url":"https://api.github.com/users/joey/events{/privacy}","received_events_url":"https://api.github.com/users/joey/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-01-23T19:10:32Z","updated_at":"2015-01-23T19:49:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"38f58eebc9cf1f47d230ee5a1e4ae8b866aa1869","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/joey/flume/pulls/1/commits","review_comments_url":"https://api.github.com/repos/joey/flume/pulls/1/comments","review_comment_url":"https://api.github.com/repos/joey/flume/pulls/comments/{number}","comments_url":"https://api.github.com/repos/joey/flume/issues/1/comments","statuses_url":"https://api.github.com/repos/joey/flume/statuses/c2705578455e849f7f4ce4dc8117bf1bccbbcf32","head":{"label":"joey:FLUME-2591-datasetsink-2.0","ref":"FLUME-2591-datasetsink-2.0","sha":"c2705578455e849f7f4ce4dc8117bf1bccbbcf32","user":{"login":"joey","id":249392,"avatar_url":"https://avatars.githubusercontent.com/u/249392?v=3","gravatar_id":"","url":"https://api.github.com/users/joey","html_url":"https://github.com/joey","followers_url":"https://api.github.com/users/joey/followers","following_url":"https://api.github.com/users/joey/following{/other_user}","gists_url":"https://api.github.com/users/joey/gists{/gist_id}","starred_url":"https://api.github.com/users/joey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joey/subscriptions","organizations_url":"https://api.github.com/users/joey/orgs","repos_url":"https://api.github.com/users/joey/repos","events_url":"https://api.github.com/users/joey/events{/privacy}","received_events_url":"https://api.github.com/users/joey/received_events","type":"User","site_admin":false},"repo":{"id":4204676,"name":"flume","full_name":"joey/flume","owner":{"login":"joey","id":249392,"avatar_url":"https://avatars.githubusercontent.com/u/249392?v=3","gravatar_id":"","url":"https://api.github.com/users/joey","html_url":"https://github.com/joey","followers_url":"https://api.github.com/users/joey/followers","following_url":"https://api.github.com/users/joey/following{/other_user}","gists_url":"https://api.github.com/users/joey/gists{/gist_id}","starred_url":"https://api.github.com/users/joey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joey/subscriptions","organizations_url":"https://api.github.com/users/joey/orgs","repos_url":"https://api.github.com/users/joey/repos","events_url":"https://api.github.com/users/joey/events{/privacy}","received_events_url":"https://api.github.com/users/joey/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/joey/flume","description":"Mirror of Apache Flume","fork":true,"url":"https://api.github.com/repos/joey/flume","forks_url":"https://api.github.com/repos/joey/flume/forks","keys_url":"https://api.github.com/repos/joey/flume/keys{/key_id}","collaborators_url":"https://api.github.com/repos/joey/flume/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/joey/flume/teams","hooks_url":"https://api.github.com/repos/joey/flume/hooks","issue_events_url":"https://api.github.com/repos/joey/flume/issues/events{/number}","events_url":"https://api.github.com/repos/joey/flume/events","assignees_url":"https://api.github.com/repos/joey/flume/assignees{/user}","branches_url":"https://api.github.com/repos/joey/flume/branches{/branch}","tags_url":"https://api.github.com/repos/joey/flume/tags","blobs_url":"https://api.github.com/repos/joey/flume/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/joey/flume/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/joey/flume/git/refs{/sha}","trees_url":"https://api.github.com/repos/joey/flume/git/trees{/sha}","statuses_url":"https://api.github.com/repos/joey/flume/statuses/{sha}","languages_url":"https://api.github.com/repos/joey/flume/languages","stargazers_url":"https://api.github.com/repos/joey/flume/stargazers","contributors_url":"https://api.github.com/repos/joey/flume/contributors","subscribers_url":"https://api.github.com/repos/joey/flume/subscribers","subscription_url":"https://api.github.com/repos/joey/flume/subscription","commits_url":"https://api.github.com/repos/joey/flume/commits{/sha}","git_commits_url":"https://api.github.com/repos/joey/flume/git/commits{/sha}","comments_url":"https://api.github.com/repos/joey/flume/comments{/number}","issue_comment_url":"https://api.github.com/repos/joey/flume/issues/comments/{number}","contents_url":"https://api.github.com/repos/joey/flume/contents/{+path}","compare_url":"https://api.github.com/repos/joey/flume/compare/{base}...{head}","merges_url":"https://api.github.com/repos/joey/flume/merges","archive_url":"https://api.github.com/repos/joey/flume/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/joey/flume/downloads","issues_url":"https://api.github.com/repos/joey/flume/issues{/number}","pulls_url":"https://api.github.com/repos/joey/flume/pulls{/number}","milestones_url":"https://api.github.com/repos/joey/flume/milestones{/number}","notifications_url":"https://api.github.com/repos/joey/flume/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/joey/flume/labels{/name}","releases_url":"https://api.github.com/repos/joey/flume/releases{/id}","created_at":"2012-05-02T15:49:57Z","updated_at":"2015-01-23T19:08:28Z","pushed_at":"2015-01-23T19:09:41Z","git_url":"git://github.com/joey/flume.git","ssh_url":"git@github.com:joey/flume.git","clone_url":"https://github.com/joey/flume.git","svn_url":"https://github.com/joey/flume","homepage":"","size":39645,"stargazers_count":1,"watchers_count":1,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":1,"default_branch":"trunk"}},"base":{"label":"joey:trunk","ref":"trunk","sha":"82631f811a7c6a4d8e6ec886f80d1a21876947e5","user":{"login":"joey","id":249392,"avatar_url":"https://avatars.githubusercontent.com/u/249392?v=3","gravatar_id":"","url":"https://api.github.com/users/joey","html_url":"https://github.com/joey","followers_url":"https://api.github.com/users/joey/followers","following_url":"https://api.github.com/users/joey/following{/other_user}","gists_url":"https://api.github.com/users/joey/gists{/gist_id}","starred_url":"https://api.github.com/users/joey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joey/subscriptions","organizations_url":"https://api.github.com/users/joey/orgs","repos_url":"https://api.github.com/users/joey/repos","events_url":"https://api.github.com/users/joey/events{/privacy}","received_events_url":"https://api.github.com/users/joey/received_events","type":"User","site_admin":false},"repo":{"id":4204676,"name":"flume","full_name":"joey/flume","owner":{"login":"joey","id":249392,"avatar_url":"https://avatars.githubusercontent.com/u/249392?v=3","gravatar_id":"","url":"https://api.github.com/users/joey","html_url":"https://github.com/joey","followers_url":"https://api.github.com/users/joey/followers","following_url":"https://api.github.com/users/joey/following{/other_user}","gists_url":"https://api.github.com/users/joey/gists{/gist_id}","starred_url":"https://api.github.com/users/joey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joey/subscriptions","organizations_url":"https://api.github.com/users/joey/orgs","repos_url":"https://api.github.com/users/joey/repos","events_url":"https://api.github.com/users/joey/events{/privacy}","received_events_url":"https://api.github.com/users/joey/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/joey/flume","description":"Mirror of Apache Flume","fork":true,"url":"https://api.github.com/repos/joey/flume","forks_url":"https://api.github.com/repos/joey/flume/forks","keys_url":"https://api.github.com/repos/joey/flume/keys{/key_id}","collaborators_url":"https://api.github.com/repos/joey/flume/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/joey/flume/teams","hooks_url":"https://api.github.com/repos/joey/flume/hooks","issue_events_url":"https://api.github.com/repos/joey/flume/issues/events{/number}","events_url":"https://api.github.com/repos/joey/flume/events","assignees_url":"https://api.github.com/repos/joey/flume/assignees{/user}","branches_url":"https://api.github.com/repos/joey/flume/branches{/branch}","tags_url":"https://api.github.com/repos/joey/flume/tags","blobs_url":"https://api.github.com/repos/joey/flume/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/joey/flume/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/joey/flume/git/refs{/sha}","trees_url":"https://api.github.com/repos/joey/flume/git/trees{/sha}","statuses_url":"https://api.github.com/repos/joey/flume/statuses/{sha}","languages_url":"https://api.github.com/repos/joey/flume/languages","stargazers_url":"https://api.github.com/repos/joey/flume/stargazers","contributors_url":"https://api.github.com/repos/joey/flume/contributors","subscribers_url":"https://api.github.com/repos/joey/flume/subscribers","subscription_url":"https://api.github.com/repos/joey/flume/subscription","commits_url":"https://api.github.com/repos/joey/flume/commits{/sha}","git_commits_url":"https://api.github.com/repos/joey/flume/git/commits{/sha}","comments_url":"https://api.github.com/repos/joey/flume/comments{/number}","issue_comment_url":"https://api.github.com/repos/joey/flume/issues/comments/{number}","contents_url":"https://api.github.com/repos/joey/flume/contents/{+path}","compare_url":"https://api.github.com/repos/joey/flume/compare/{base}...{head}","merges_url":"https://api.github.com/repos/joey/flume/merges","archive_url":"https://api.github.com/repos/joey/flume/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/joey/flume/downloads","issues_url":"https://api.github.com/repos/joey/flume/issues{/number}","pulls_url":"https://api.github.com/repos/joey/flume/pulls{/number}","milestones_url":"https://api.github.com/repos/joey/flume/milestones{/number}","notifications_url":"https://api.github.com/repos/joey/flume/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/joey/flume/labels{/name}","releases_url":"https://api.github.com/repos/joey/flume/releases{/id}","created_at":"2012-05-02T15:49:57Z","updated_at":"2015-01-23T19:08:28Z","pushed_at":"2015-01-23T19:09:41Z","git_url":"git://github.com/joey/flume.git","ssh_url":"git@github.com:joey/flume.git","clone_url":"https://github.com/joey/flume.git","svn_url":"https://github.com/joey/flume","homepage":"","size":39645,"stargazers_count":1,"watchers_count":1,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":1,"default_branch":"trunk"}},"_links":{"self":{"href":"https://api.github.com/repos/joey/flume/pulls/1"},"html":{"href":"https://github.com/joey/flume/pull/1"},"issue":{"href":"https://api.github.com/repos/joey/flume/issues/1"},"comments":{"href":"https://api.github.com/repos/joey/flume/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/joey/flume/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/joey/flume/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/joey/flume/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/joey/flume/statuses/c2705578455e849f7f4ce4dc8117bf1bccbbcf32"}}}}