{"action":"created","comment":{"url":"https://api.github.com/repos/integralads/nutch/pulls/comments/30977646","id":30977646,"diff_hunk":"@@ -0,0 +1,25 @@\n+package org.apache.nutch.storage;\n+\n+import com.google.common.hash.HashFunction;\n+import com.google.common.hash.Hashing;\n+import org.apache.hadoop.conf.Configuration;\n+\n+public class HashUtils {\n+\n+  public static final String DELIMITER = \"|\";\n+  public static final String HASH_KEYS_ENABLED_PROPERTY = \"hash.keys.enabled\";\n+  private static final Boolean DEFAULT_HASHED_KEYS = false;\n+  private static final HashFunction hashFunction = Hashing.murmur3_32();\n+\n+  public static String hashify(String rowKey) {\n+    return hashFunction.hashString(rowKey) + DELIMITER + rowKey;\n+  }\n+\n+  public static String dehashify(String hashifiedKey) {\n+    return hashifiedKey.substring(hashFunction.bits() / 4 + DELIMITER.length());","path":"src/java/org/apache/nutch/storage/HashUtils.java","position":19,"original_position":19,"commit_id":"fe2e91631b9cb35434bb98426219b82e58546515","original_commit_id":"fe2e91631b9cb35434bb98426219b82e58546515","user":{"login":"SergeyWeiss","id":2960633,"avatar_url":"https://avatars.githubusercontent.com/u/2960633?v=3","gravatar_id":"","url":"https://api.github.com/users/SergeyWeiss","html_url":"https://github.com/SergeyWeiss","followers_url":"https://api.github.com/users/SergeyWeiss/followers","following_url":"https://api.github.com/users/SergeyWeiss/following{/other_user}","gists_url":"https://api.github.com/users/SergeyWeiss/gists{/gist_id}","starred_url":"https://api.github.com/users/SergeyWeiss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SergeyWeiss/subscriptions","organizations_url":"https://api.github.com/users/SergeyWeiss/orgs","repos_url":"https://api.github.com/users/SergeyWeiss/repos","events_url":"https://api.github.com/users/SergeyWeiss/events{/privacy}","received_events_url":"https://api.github.com/users/SergeyWeiss/received_events","type":"User","site_admin":false},"body":"Why do we divide by 4? Just curious","created_at":"2015-05-25T12:35:56Z","updated_at":"2015-05-25T12:35:56Z","html_url":"https://github.com/integralads/nutch/pull/49#discussion_r30977646","pull_request_url":"https://api.github.com/repos/integralads/nutch/pulls/49","_links":{"self":{"href":"https://api.github.com/repos/integralads/nutch/pulls/comments/30977646"},"html":{"href":"https://github.com/integralads/nutch/pull/49#discussion_r30977646"},"pull_request":{"href":"https://api.github.com/repos/integralads/nutch/pulls/49"}}},"pull_request":{"url":"https://api.github.com/repos/integralads/nutch/pulls/49","id":35499626,"html_url":"https://github.com/integralads/nutch/pull/49","diff_url":"https://github.com/integralads/nutch/pull/49.diff","patch_url":"https://github.com/integralads/nutch/pull/49.patch","issue_url":"https://api.github.com/repos/integralads/nutch/issues/49","number":49,"state":"open","locked":false,"title":"[CRAW-87] Create input and output gora format decorators for inserting hash prefix to keys","user":{"login":"kgusakov","id":850525,"avatar_url":"https://avatars.githubusercontent.com/u/850525?v=3","gravatar_id":"","url":"https://api.github.com/users/kgusakov","html_url":"https://github.com/kgusakov","followers_url":"https://api.github.com/users/kgusakov/followers","following_url":"https://api.github.com/users/kgusakov/following{/other_user}","gists_url":"https://api.github.com/users/kgusakov/gists{/gist_id}","starred_url":"https://api.github.com/users/kgusakov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kgusakov/subscriptions","organizations_url":"https://api.github.com/users/kgusakov/orgs","repos_url":"https://api.github.com/users/kgusakov/repos","events_url":"https://api.github.com/users/kgusakov/events{/privacy}","received_events_url":"https://api.github.com/users/kgusakov/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-05-15T10:00:05Z","updated_at":"2015-05-25T12:35:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4525d2c286b9f812aae8e7deb9d95edce5a7b344","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/integralads/nutch/pulls/49/commits","review_comments_url":"https://api.github.com/repos/integralads/nutch/pulls/49/comments","review_comment_url":"https://api.github.com/repos/integralads/nutch/pulls/comments{/number}","comments_url":"https://api.github.com/repos/integralads/nutch/issues/49/comments","statuses_url":"https://api.github.com/repos/integralads/nutch/statuses/fe2e91631b9cb35434bb98426219b82e58546515","head":{"label":"integralads:fb/craw-87-hash-keys","ref":"fb/craw-87-hash-keys","sha":"fe2e91631b9cb35434bb98426219b82e58546515","user":{"login":"integralads","id":5453442,"avatar_url":"https://avatars.githubusercontent.com/u/5453442?v=3","gravatar_id":"","url":"https://api.github.com/users/integralads","html_url":"https://github.com/integralads","followers_url":"https://api.github.com/users/integralads/followers","following_url":"https://api.github.com/users/integralads/following{/other_user}","gists_url":"https://api.github.com/users/integralads/gists{/gist_id}","starred_url":"https://api.github.com/users/integralads/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/integralads/subscriptions","organizations_url":"https://api.github.com/users/integralads/orgs","repos_url":"https://api.github.com/users/integralads/repos","events_url":"https://api.github.com/users/integralads/events{/privacy}","received_events_url":"https://api.github.com/users/integralads/received_events","type":"Organization","site_admin":false},"repo":{"id":18609752,"name":"nutch","full_name":"integralads/nutch","owner":{"login":"integralads","id":5453442,"avatar_url":"https://avatars.githubusercontent.com/u/5453442?v=3","gravatar_id":"","url":"https://api.github.com/users/integralads","html_url":"https://github.com/integralads","followers_url":"https://api.github.com/users/integralads/followers","following_url":"https://api.github.com/users/integralads/following{/other_user}","gists_url":"https://api.github.com/users/integralads/gists{/gist_id}","starred_url":"https://api.github.com/users/integralads/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/integralads/subscriptions","organizations_url":"https://api.github.com/users/integralads/orgs","repos_url":"https://api.github.com/users/integralads/repos","events_url":"https://api.github.com/users/integralads/events{/privacy}","received_events_url":"https://api.github.com/users/integralads/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/integralads/nutch","description":"Mirror of Apache Nutch","fork":true,"url":"https://api.github.com/repos/integralads/nutch","forks_url":"https://api.github.com/repos/integralads/nutch/forks","keys_url":"https://api.github.com/repos/integralads/nutch/keys{/key_id}","collaborators_url":"https://api.github.com/repos/integralads/nutch/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/integralads/nutch/teams","hooks_url":"https://api.github.com/repos/integralads/nutch/hooks","issue_events_url":"https://api.github.com/repos/integralads/nutch/issues/events{/number}","events_url":"https://api.github.com/repos/integralads/nutch/events","assignees_url":"https://api.github.com/repos/integralads/nutch/assignees{/user}","branches_url":"https://api.github.com/repos/integralads/nutch/branches{/branch}","tags_url":"https://api.github.com/repos/integralads/nutch/tags","blobs_url":"https://api.github.com/repos/integralads/nutch/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/integralads/nutch/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/integralads/nutch/git/refs{/sha}","trees_url":"https://api.github.com/repos/integralads/nutch/git/trees{/sha}","statuses_url":"https://api.github.com/repos/integralads/nutch/statuses/{sha}","languages_url":"https://api.github.com/repos/integralads/nutch/languages","stargazers_url":"https://api.github.com/repos/integralads/nutch/stargazers","contributors_url":"https://api.github.com/repos/integralads/nutch/contributors","subscribers_url":"https://api.github.com/repos/integralads/nutch/subscribers","subscription_url":"https://api.github.com/repos/integralads/nutch/subscription","commits_url":"https://api.github.com/repos/integralads/nutch/commits{/sha}","git_commits_url":"https://api.github.com/repos/integralads/nutch/git/commits{/sha}","comments_url":"https://api.github.com/repos/integralads/nutch/comments{/number}","issue_comment_url":"https://api.github.com/repos/integralads/nutch/issues/comments{/number}","contents_url":"https://api.github.com/repos/integralads/nutch/contents/{+path}","compare_url":"https://api.github.com/repos/integralads/nutch/compare/{base}...{head}","merges_url":"https://api.github.com/repos/integralads/nutch/merges","archive_url":"https://api.github.com/repos/integralads/nutch/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/integralads/nutch/downloads","issues_url":"https://api.github.com/repos/integralads/nutch/issues{/number}","pulls_url":"https://api.github.com/repos/integralads/nutch/pulls{/number}","milestones_url":"https://api.github.com/repos/integralads/nutch/milestones{/number}","notifications_url":"https://api.github.com/repos/integralads/nutch/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/integralads/nutch/labels{/name}","releases_url":"https://api.github.com/repos/integralads/nutch/releases{/id}","created_at":"2014-04-09T19:15:02Z","updated_at":"2014-04-23T15:20:24Z","pushed_at":"2015-05-22T16:52:41Z","git_url":"git://github.com/integralads/nutch.git","ssh_url":"git@github.com:integralads/nutch.git","clone_url":"https://github.com/integralads/nutch.git","svn_url":"https://github.com/integralads/nutch","homepage":null,"size":121633,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"2.1"}},"base":{"label":"integralads:hash-keys","ref":"hash-keys","sha":"edec16721c59d51288b5d82c750adb0652d3b0b2","user":{"login":"integralads","id":5453442,"avatar_url":"https://avatars.githubusercontent.com/u/5453442?v=3","gravatar_id":"","url":"https://api.github.com/users/integralads","html_url":"https://github.com/integralads","followers_url":"https://api.github.com/users/integralads/followers","following_url":"https://api.github.com/users/integralads/following{/other_user}","gists_url":"https://api.github.com/users/integralads/gists{/gist_id}","starred_url":"https://api.github.com/users/integralads/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/integralads/subscriptions","organizations_url":"https://api.github.com/users/integralads/orgs","repos_url":"https://api.github.com/users/integralads/repos","events_url":"https://api.github.com/users/integralads/events{/privacy}","received_events_url":"https://api.github.com/users/integralads/received_events","type":"Organization","site_admin":false},"repo":{"id":18609752,"name":"nutch","full_name":"integralads/nutch","owner":{"login":"integralads","id":5453442,"avatar_url":"https://avatars.githubusercontent.com/u/5453442?v=3","gravatar_id":"","url":"https://api.github.com/users/integralads","html_url":"https://github.com/integralads","followers_url":"https://api.github.com/users/integralads/followers","following_url":"https://api.github.com/users/integralads/following{/other_user}","gists_url":"https://api.github.com/users/integralads/gists{/gist_id}","starred_url":"https://api.github.com/users/integralads/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/integralads/subscriptions","organizations_url":"https://api.github.com/users/integralads/orgs","repos_url":"https://api.github.com/users/integralads/repos","events_url":"https://api.github.com/users/integralads/events{/privacy}","received_events_url":"https://api.github.com/users/integralads/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/integralads/nutch","description":"Mirror of Apache Nutch","fork":true,"url":"https://api.github.com/repos/integralads/nutch","forks_url":"https://api.github.com/repos/integralads/nutch/forks","keys_url":"https://api.github.com/repos/integralads/nutch/keys{/key_id}","collaborators_url":"https://api.github.com/repos/integralads/nutch/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/integralads/nutch/teams","hooks_url":"https://api.github.com/repos/integralads/nutch/hooks","issue_events_url":"https://api.github.com/repos/integralads/nutch/issues/events{/number}","events_url":"https://api.github.com/repos/integralads/nutch/events","assignees_url":"https://api.github.com/repos/integralads/nutch/assignees{/user}","branches_url":"https://api.github.com/repos/integralads/nutch/branches{/branch}","tags_url":"https://api.github.com/repos/integralads/nutch/tags","blobs_url":"https://api.github.com/repos/integralads/nutch/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/integralads/nutch/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/integralads/nutch/git/refs{/sha}","trees_url":"https://api.github.com/repos/integralads/nutch/git/trees{/sha}","statuses_url":"https://api.github.com/repos/integralads/nutch/statuses/{sha}","languages_url":"https://api.github.com/repos/integralads/nutch/languages","stargazers_url":"https://api.github.com/repos/integralads/nutch/stargazers","contributors_url":"https://api.github.com/repos/integralads/nutch/contributors","subscribers_url":"https://api.github.com/repos/integralads/nutch/subscribers","subscription_url":"https://api.github.com/repos/integralads/nutch/subscription","commits_url":"https://api.github.com/repos/integralads/nutch/commits{/sha}","git_commits_url":"https://api.github.com/repos/integralads/nutch/git/commits{/sha}","comments_url":"https://api.github.com/repos/integralads/nutch/comments{/number}","issue_comment_url":"https://api.github.com/repos/integralads/nutch/issues/comments{/number}","contents_url":"https://api.github.com/repos/integralads/nutch/contents/{+path}","compare_url":"https://api.github.com/repos/integralads/nutch/compare/{base}...{head}","merges_url":"https://api.github.com/repos/integralads/nutch/merges","archive_url":"https://api.github.com/repos/integralads/nutch/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/integralads/nutch/downloads","issues_url":"https://api.github.com/repos/integralads/nutch/issues{/number}","pulls_url":"https://api.github.com/repos/integralads/nutch/pulls{/number}","milestones_url":"https://api.github.com/repos/integralads/nutch/milestones{/number}","notifications_url":"https://api.github.com/repos/integralads/nutch/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/integralads/nutch/labels{/name}","releases_url":"https://api.github.com/repos/integralads/nutch/releases{/id}","created_at":"2014-04-09T19:15:02Z","updated_at":"2014-04-23T15:20:24Z","pushed_at":"2015-05-22T16:52:41Z","git_url":"git://github.com/integralads/nutch.git","ssh_url":"git@github.com:integralads/nutch.git","clone_url":"https://github.com/integralads/nutch.git","svn_url":"https://github.com/integralads/nutch","homepage":null,"size":121633,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"2.1"}},"_links":{"self":{"href":"https://api.github.com/repos/integralads/nutch/pulls/49"},"html":{"href":"https://github.com/integralads/nutch/pull/49"},"issue":{"href":"https://api.github.com/repos/integralads/nutch/issues/49"},"comments":{"href":"https://api.github.com/repos/integralads/nutch/issues/49/comments"},"review_comments":{"href":"https://api.github.com/repos/integralads/nutch/pulls/49/comments"},"review_comment":{"href":"https://api.github.com/repos/integralads/nutch/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/integralads/nutch/pulls/49/commits"},"statuses":{"href":"https://api.github.com/repos/integralads/nutch/statuses/fe2e91631b9cb35434bb98426219b82e58546515"}}}}