GitHub PullRequestReviewCommentEvent at 2014-09-09 19:27:19
Repository: fluo
Actor: keith-turner
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/fluo-io/fluo/pulls/comments/17322194","id":17322194,"diff_hunk":"@@ -0,0 +1,91 @@\n+/*\n+ * Copyright 2014 Fluo authors (see AUTHORS)\n+ *\n+ * Licensed under the Apache License, Version 2.0 (the \"License\");\n+ * you may not use this file except in compliance with the License.\n+ * 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+package io.fluo.accumulo.util;\n+\n+import java.io.IOException;\n+\n+import org.apache.zookeeper.KeeperException;\n+import org.apache.zookeeper.ZooKeeper;\n+import org.slf4j.Logger;\n+import org.slf4j.LoggerFactory;\n+\n+/**\n+ * Helper methods for retrieving oldest active timestamp from Zookeeper\n+ */\n+public class ZookeeperUtil {\n+  \n+  private static Logger log = LoggerFactory.getLogger(ZookeeperUtil.class);\n+  \n+  private static final Long OLDEST_POSSIBLE = new Long(-1);\n+  \n+  private ZookeeperUtil() {}\n+  \n+  /**\n+   * Retrieves the oldest active timestamp in Fluo by scanning zookeeper\n+   * \n+   * @param zookeepers Zookeeper connection string\n+   * @param zkPath Zookeeer root path\n+   * @return Oldest active timestamp or oldest possible ts (-1) if not found\n+   */\n+  public static Long getOldestTimestamp(String zookeepers, String zkPath) {\n+    Long oldestTs = Long.MAX_VALUE;\n+    boolean nodeFound = false;\n+    \n+    ZooKeeper zk;\n+    try {\n+      zk = new ZooKeeper(zookeepers, 30000, null);\n+    } catch (IOException e) {\n+      throw new IllegalStateException(e);\n+    }\n+    \n+    // Try to find oldest active timestamp of transactors \n+    String tsRootPath = ZookeeperConstants.transactorTsRoot(zkPath);\n+    try {\n+      if (zk.exists(tsRootPath, false) != null) { \n+        for (String child : zk.getChildren(tsRootPath, false)) {\n+          Long ts = LongUtil.fromByteArray(zk.getData(tsRootPath+\"/\"+child, false, null));\n+          nodeFound = true;\n+          if (ts < oldestTs) {\n+            oldestTs = ts;\n+          }\n+        }\n+      }\n+    } catch (Exception e) {\n+      log.error(\"Failed to get oldest timestamp of transactors from Zookeeper\");\n+      e.printStackTrace();","path":"modules/accumulo/src/main/java/io/fluo/accumulo/util/ZookeeperUtil.java","position":null,"original_position":68,"commit_id":"1b9cc0aa230391a9cab06d76055c7778327a4336","original_commit_id":"9d545c5892b3fc3f9a4b1de6b685df07080b0345","user":{"login":"keith-turner","id":1268739,"avatar_url":"https://avatars.githubusercontent.com/u/1268739?v=2","gravatar_id":"081038f63935d5c7539f8eca4c4091d1","url":"https://api.github.com/users/keith-turner","html_url":"https://github.com/keith-turner","followers_url":"https://api.github.com/users/keith-turner/followers","following_url":"https://api.github.com/users/keith-turner/following{/other_user}","gists_url":"https://api.github.com/users/keith-turner/gists{/gist_id}","starred_url":"https://api.github.com/users/keith-turner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keith-turner/subscriptions","organizations_url":"https://api.github.com/users/keith-turner/orgs","repos_url":"https://api.github.com/users/keith-turner/repos","events_url":"https://api.github.com/users/keith-turner/events{/privacy}","received_events_url":"https://api.github.com/users/keith-turner/received_events","type":"User","site_admin":false},"body":"instead of printing this stack trace, should pass it to logger","created_at":"2014-09-09T19:27:19Z","updated_at":"2014-09-09T19:27:19Z","html_url":"https://github.com/fluo-io/fluo/pull/157#discussion_r17322194","pull_request_url":"https://api.github.com/repos/fluo-io/fluo/pulls/157","_links":{"self":{"href":"https://api.github.com/repos/fluo-io/fluo/pulls/comments/17322194"},"html":{"href":"https://github.com/fluo-io/fluo/pull/157#discussion_r17322194"},"pull_request":{"href":"https://api.github.com/repos/fluo-io/fluo/pulls/157"}}},"pull_request":{"url":"https://api.github.com/repos/fluo-io/fluo/pulls/157","id":20472222,"html_url":"https://github.com/fluo-io/fluo/pull/157","diff_url":"https://github.com/fluo-io/fluo/pull/157.diff","patch_url":"https://github.com/fluo-io/fluo/pull/157.patch","issue_url":"https://api.github.com/repos/fluo-io/fluo/issues/157","number":157,"state":"open","locked":false,"title":"Closes #8 - Made garbage collection iterator determine oldest active snapshot.  ","user":{"login":"mikewalch","id":730698,"avatar_url":"https://avatars.githubusercontent.com/u/730698?v=2","gravatar_id":"4cb3e33cdd42852f7c219193033de7e3","url":"https://api.github.com/users/mikewalch","html_url":"https://github.com/mikewalch","followers_url":"https://api.github.com/users/mikewalch/followers","following_url":"https://api.github.com/users/mikewalch/following{/other_user}","gists_url":"https://api.github.com/users/mikewalch/gists{/gist_id}","starred_url":"https://api.github.com/users/mikewalch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikewalch/subscriptions","organizations_url":"https://api.github.com/users/mikewalch/orgs","repos_url":"https://api.github.com/users/mikewalch/repos","events_url":"https://api.github.com/users/mikewalch/events{/privacy}","received_events_url":"https://api.github.com/users/mikewalch/received_events","type":"User","site_admin":false},"body":"Pull request for #8 \r\n\r\nCreated TimestampTracker to keep track of timestamps in Zookeeper.  Modified GC iterator to get oldest active timstamp from Zookeeper. Created integration tests for TimestampTracker and GCIterator","created_at":"2014-08-28T22:48:38Z","updated_at":"2014-09-09T19:27:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9e3af60d801b99ce61a31c120bff13a44774b74d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/fluo-io/fluo/pulls/157/commits","review_comments_url":"https://api.github.com/repos/fluo-io/fluo/pulls/157/comments","review_comment_url":"https://api.github.com/repos/fluo-io/fluo/pulls/comments/{number}","comments_url":"https://api.github.com/repos/fluo-io/fluo/issues/157/comments","statuses_url":"https://api.github.com/repos/fluo-io/fluo/statuses/1b9cc0aa230391a9cab06d76055c7778327a4336","head":{"label":"mikewalch:fluo-8","ref":"fluo-8","sha":"1b9cc0aa230391a9cab06d76055c7778327a4336","user":{"login":"mikewalch","id":730698,"avatar_url":"https://avatars.githubusercontent.com/u/730698?v=2","gravatar_id":"4cb3e33cdd42852f7c219193033de7e3","url":"https://api.github.com/users/mikewalch","html_url":"https://github.com/mikewalch","followers_url":"https://api.github.com/users/mikewalch/followers","following_url":"https://api.github.com/users/mikewalch/following{/other_user}","gists_url":"https://api.github.com/users/mikewalch/gists{/gist_id}","starred_url":"https://api.github.com/users/mikewalch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikewalch/subscriptions","organizations_url":"https://api.github.com/users/mikewalch/orgs","repos_url":"https://api.github.com/users/mikewalch/repos","events_url":"https://api.github.com/users/mikewalch/events{/privacy}","received_events_url":"https://api.github.com/users/mikewalch/received_events","type":"User","site_admin":false},"repo":{"id":19742131,"name":"fluo","full_name":"mikewalch/fluo","owner":{"login":"mikewalch","id":730698,"avatar_url":"https://avatars.githubusercontent.com/u/730698?v=2","gravatar_id":"4cb3e33cdd42852f7c219193033de7e3","url":"https://api.github.com/users/mikewalch","html_url":"https://github.com/mikewalch","followers_url":"https://api.github.com/users/mikewalch/followers","following_url":"https://api.github.com/users/mikewalch/following{/other_user}","gists_url":"https://api.github.com/users/mikewalch/gists{/gist_id}","starred_url":"https://api.github.com/users/mikewalch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikewalch/subscriptions","organizations_url":"https://api.github.com/users/mikewalch/orgs","repos_url":"https://api.github.com/users/mikewalch/repos","events_url":"https://api.github.com/users/mikewalch/events{/privacy}","received_events_url":"https://api.github.com/users/mikewalch/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mikewalch/fluo","description":"","fork":true,"url":"https://api.github.com/repos/mikewalch/fluo","forks_url":"https://api.github.com/repos/mikewalch/fluo/forks","keys_url":"https://api.github.com/repos/mikewalch/fluo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mikewalch/fluo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mikewalch/fluo/teams","hooks_url":"https://api.github.com/repos/mikewalch/fluo/hooks","issue_events_url":"https://api.github.com/repos/mikewalch/fluo/issues/events{/number}","events_url":"https://api.github.com/repos/mikewalch/fluo/events","assignees_url":"https://api.github.com/repos/mikewalch/fluo/assignees{/user}","branches_url":"https://api.github.com/repos/mikewalch/fluo/branches{/branch}","tags_url":"https://api.github.com/repos/mikewalch/fluo/tags","blobs_url":"https://api.github.com/repos/mikewalch/fluo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mikewalch/fluo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mikewalch/fluo/git/refs{/sha}","trees_url":"https://api.github.com/repos/mikewalch/fluo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mikewalch/fluo/statuses/{sha}","languages_url":"https://api.github.com/repos/mikewalch/fluo/languages","stargazers_url":"https://api.github.com/repos/mikewalch/fluo/stargazers","contributors_url":"https://api.github.com/repos/mikewalch/fluo/contributors","subscribers_url":"https://api.github.com/repos/mikewalch/fluo/subscribers","subscription_url":"https://api.github.com/repos/mikewalch/fluo/subscription","commits_url":"https://api.github.com/repos/mikewalch/fluo/commits{/sha}","git_commits_url":"https://api.github.com/repos/mikewalch/fluo/git/commits{/sha}","comments_url":"https://api.github.com/repos/mikewalch/fluo/comments{/number}","issue_comment_url":"https://api.github.com/repos/mikewalch/fluo/issues/comments/{number}","contents_url":"https://api.github.com/repos/mikewalch/fluo/contents/{+path}","compare_url":"https://api.github.com/repos/mikewalch/fluo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mikewalch/fluo/merges","archive_url":"https://api.github.com/repos/mikewalch/fluo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mikewalch/fluo/downloads","issues_url":"https://api.github.com/repos/mikewalch/fluo/issues{/number}","pulls_url":"https://api.github.com/repos/mikewalch/fluo/pulls{/number}","milestones_url":"https://api.github.com/repos/mikewalch/fluo/milestones{/number}","notifications_url":"https://api.github.com/repos/mikewalch/fluo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mikewalch/fluo/labels{/name}","releases_url":"https://api.github.com/repos/mikewalch/fluo/releases{/id}","created_at":"2014-05-13T14:25:42Z","updated_at":"2014-07-16T22:12:50Z","pushed_at":"2014-09-09T19:25:02Z","git_url":"git://github.com/mikewalch/fluo.git","ssh_url":"git@github.com:mikewalch/fluo.git","clone_url":"https://github.com/mikewalch/fluo.git","svn_url":"https://github.com/mikewalch/fluo","homepage":null,"size":2050,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"fluo-io:master","ref":"master","sha":"09e3a89515080fc797286b7b8caf8f79b0b8850c","user":{"login":"fluo-io","id":8184450,"avatar_url":"https://avatars.githubusercontent.com/u/8184450?v=2","gravatar_id":null,"url":"https://api.github.com/users/fluo-io","html_url":"https://github.com/fluo-io","followers_url":"https://api.github.com/users/fluo-io/followers","following_url":"https://api.github.com/users/fluo-io/following{/other_user}","gists_url":"https://api.github.com/users/fluo-io/gists{/gist_id}","starred_url":"https://api.github.com/users/fluo-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fluo-io/subscriptions","organizations_url":"https://api.github.com/users/fluo-io/orgs","repos_url":"https://api.github.com/users/fluo-io/repos","events_url":"https://api.github.com/users/fluo-io/events{/privacy}","received_events_url":"https://api.github.com/users/fluo-io/received_events","type":"Organization","site_admin":false},"repo":{"id":10805187,"name":"fluo","full_name":"fluo-io/fluo","owner":{"login":"fluo-io","id":8184450,"avatar_url":"https://avatars.githubusercontent.com/u/8184450?v=2","gravatar_id":null,"url":"https://api.github.com/users/fluo-io","html_url":"https://github.com/fluo-io","followers_url":"https://api.github.com/users/fluo-io/followers","following_url":"https://api.github.com/users/fluo-io/following{/other_user}","gists_url":"https://api.github.com/users/fluo-io/gists{/gist_id}","starred_url":"https://api.github.com/users/fluo-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fluo-io/subscriptions","organizations_url":"https://api.github.com/users/fluo-io/orgs","repos_url":"https://api.github.com/users/fluo-io/repos","events_url":"https://api.github.com/users/fluo-io/events{/privacy}","received_events_url":"https://api.github.com/users/fluo-io/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/fluo-io/fluo","description":"","fork":false,"url":"https://api.github.com/repos/fluo-io/fluo","forks_url":"https://api.github.com/repos/fluo-io/fluo/forks","keys_url":"https://api.github.com/repos/fluo-io/fluo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fluo-io/fluo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fluo-io/fluo/teams","hooks_url":"https://api.github.com/repos/fluo-io/fluo/hooks","issue_events_url":"https://api.github.com/repos/fluo-io/fluo/issues/events{/number}","events_url":"https://api.github.com/repos/fluo-io/fluo/events","assignees_url":"https://api.github.com/repos/fluo-io/fluo/assignees{/user}","branches_url":"https://api.github.com/repos/fluo-io/fluo/branches{/branch}","tags_url":"https://api.github.com/repos/fluo-io/fluo/tags","blobs_url":"https://api.github.com/repos/fluo-io/fluo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fluo-io/fluo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fluo-io/fluo/git/refs{/sha}","trees_url":"https://api.github.com/repos/fluo-io/fluo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fluo-io/fluo/statuses/{sha}","languages_url":"https://api.github.com/repos/fluo-io/fluo/languages","stargazers_url":"https://api.github.com/repos/fluo-io/fluo/stargazers","contributors_url":"https://api.github.com/repos/fluo-io/fluo/contributors","subscribers_url":"https://api.github.com/repos/fluo-io/fluo/subscribers","subscription_url":"https://api.github.com/repos/fluo-io/fluo/subscription","commits_url":"https://api.github.com/repos/fluo-io/fluo/commits{/sha}","git_commits_url":"https://api.github.com/repos/fluo-io/fluo/git/commits{/sha}","comments_url":"https://api.github.com/repos/fluo-io/fluo/comments{/number}","issue_comment_url":"https://api.github.com/repos/fluo-io/fluo/issues/comments/{number}","contents_url":"https://api.github.com/repos/fluo-io/fluo/contents/{+path}","compare_url":"https://api.github.com/repos/fluo-io/fluo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fluo-io/fluo/merges","archive_url":"https://api.github.com/repos/fluo-io/fluo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fluo-io/fluo/downloads","issues_url":"https://api.github.com/repos/fluo-io/fluo/issues{/number}","pulls_url":"https://api.github.com/repos/fluo-io/fluo/pulls{/number}","milestones_url":"https://api.github.com/repos/fluo-io/fluo/milestones{/number}","notifications_url":"https://api.github.com/repos/fluo-io/fluo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fluo-io/fluo/labels{/name}","releases_url":"https://api.github.com/repos/fluo-io/fluo/releases{/id}","created_at":"2013-06-19T20:14:05Z","updated_at":"2014-09-06T00:54:23Z","pushed_at":"2014-09-06T00:54:23Z","git_url":"git://github.com/fluo-io/fluo.git","ssh_url":"git@github.com:fluo-io/fluo.git","clone_url":"https://github.com/fluo-io/fluo.git","svn_url":"https://github.com/fluo-io/fluo","homepage":null,"size":3410,"stargazers_count":8,"watchers_count":8,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"forks_count":5,"mirror_url":null,"open_issues_count":65,"forks":5,"open_issues":65,"watchers":8,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/fluo-io/fluo/pulls/157"},"html":{"href":"https://github.com/fluo-io/fluo/pull/157"},"issue":{"href":"https://api.github.com/repos/fluo-io/fluo/issues/157"},"comments":{"href":"https://api.github.com/repos/fluo-io/fluo/issues/157/comments"},"review_comments":{"href":"https://api.github.com/repos/fluo-io/fluo/pulls/157/comments"},"review_comment":{"href":"https://api.github.com/repos/fluo-io/fluo/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/fluo-io/fluo/pulls/157/commits"},"statuses":{"href":"https://api.github.com/repos/fluo-io/fluo/statuses/1b9cc0aa230391a9cab06d76055c7778327a4336"}}}}