{"action":"created","comment":{"url":"https://api.github.com/repos/Ramizjon/LearnProjectParquet/pulls/comments/50852743","id":50852743,"diff_hunk":"@@ -0,0 +1,97 @@\n+package domain;\n+\n+import java.io.IOException;\n+import java.text.SimpleDateFormat;\n+import java.util.LinkedList;\n+\n+import org.apache.hadoop.conf.Configuration;\n+import org.apache.zookeeper.AsyncCallback.StatCallback;\n+import org.apache.hadoop.conf.Configuration;\n+import org.apache.hadoop.hbase.HBaseConfiguration;\n+import org.apache.hadoop.hbase.client.Delete;\n+import org.apache.hadoop.hbase.client.HTable;\n+import org.apache.hadoop.hbase.client.Put;\n+import org.apache.hadoop.hbase.util.Bytes;\n+\n+\n+public class UserRepository {\n+\tLinkedList <User> cachedList;\n+\tprivate final int BUFFER_SIZE = 1;\n+\tprivate static UserRepository instance;\n+\tprivate Configuration config;\n+\tprivate  HTable hTable;\n+\t\n+\t//TODO approach will be changed\n+\tpublic static UserRepository getInstance (){\n+\t\tif (instance == null){\n+\t\t\tinstance  = new UserRepository();\n+\t\t}\n+\t\treturn instance;\n+\t}\n+\t\n+\tpublic UserRepository (){\n+\t\tcachedList = new LinkedList<User>();\n+\t\tconfig = HBaseConfiguration.create();\n+\t\ttry {\n+\t\t\thTable = new HTable(config, \"users\");\n+\t\t} catch (IOException e) {\n+\t\t\te.printStackTrace();\n+\t\t}\n+\t}\n+\t\n+\tpublic void addUserToTempQueue(int userId, LinkedList<String> segments){\n+\t\tcachedList.add(new User(userId, segments));\n+\t\tthis.checkForBulk();\n+\t}\n+\t\n+\tpublic void checkForBulk(){\n+\t\tif (cachedList.size()==BUFFER_SIZE){\n+\t\t\tthis.addUsersToHbase();\n+\t\t\tcachedList.clear();\n+\t\t}\n+\t}\n+\t\n+\t//just for debug\n+\tpublic String print(){\n+\t\tStringBuilder sb = new StringBuilder();\n+\t\tfor (User user: cachedList){\n+\t\t\tsb.append(user.getSegments() + \" \");\n+\t\t}\n+\t\treturn (\"------------\\n\" + sb.toString());\n+\t}\n+\t\n+\tpublic void addUsersToHbase (){\n+\t\tPut put = null;\n+\t\tfor (User u: cachedList){\n+\t\t\tput = new Put(Bytes.toBytes(\"Id\" + String.valueOf(u.getUserId())));\n+\t\t\tfor (String segm: u.getSegments()){\n+\t\t\t\tString timeStamp = new SimpleDateFormat(\"yyyy/MM/dd HH:mm:ss\").format(System.currentTimeMillis());\n+\t\t\t\tput.add(Bytes.toBytes(\"general\"),Bytes.toBytes(segm),Bytes.toBytes(timeStamp));\n+\t\t\t\ttry {\n+\t\t\t\t\thTable.put(put);\n+\t\t\t\t} catch (IOException e) {\n+\t\t\t\t\te.printStackTrace();","path":"src/main/java/domain/UserRepository.java","position":73,"original_position":73,"commit_id":"2082700fa674136513ac37b6ed3aeb2a94b6cc46","original_commit_id":"2082700fa674136513ac37b6ed3aeb2a94b6cc46","user":{"login":"btrofimov","id":1196038,"avatar_url":"https://avatars.githubusercontent.com/u/1196038?v=3","gravatar_id":"","url":"https://api.github.com/users/btrofimov","html_url":"https://github.com/btrofimov","followers_url":"https://api.github.com/users/btrofimov/followers","following_url":"https://api.github.com/users/btrofimov/following{/other_user}","gists_url":"https://api.github.com/users/btrofimov/gists{/gist_id}","starred_url":"https://api.github.com/users/btrofimov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/btrofimov/subscriptions","organizations_url":"https://api.github.com/users/btrofimov/orgs","repos_url":"https://api.github.com/users/btrofimov/repos","events_url":"https://api.github.com/users/btrofimov/events{/privacy}","received_events_url":"https://api.github.com/users/btrofimov/received_events","type":"User","site_admin":false},"body":"Do not dismiss such kind of error and remove printStackTrace at all from here. Moreover Repository *must* throw up any excpeptions and only upstream logic should decide if this particular exception shall be dismissed.","created_at":"2016-01-26T15:50:48Z","updated_at":"2016-01-26T15:50:48Z","html_url":"https://github.com/Ramizjon/LearnProjectParquet/pull/1#discussion_r50852743","pull_request_url":"https://api.github.com/repos/Ramizjon/LearnProjectParquet/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/Ramizjon/LearnProjectParquet/pulls/comments/50852743"},"html":{"href":"https://github.com/Ramizjon/LearnProjectParquet/pull/1#discussion_r50852743"},"pull_request":{"href":"https://api.github.com/repos/Ramizjon/LearnProjectParquet/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/Ramizjon/LearnProjectParquet/pulls/1","id":54970072,"html_url":"https://github.com/Ramizjon/LearnProjectParquet/pull/1","diff_url":"https://github.com/Ramizjon/LearnProjectParquet/pull/1.diff","patch_url":"https://github.com/Ramizjon/LearnProjectParquet/pull/1.patch","issue_url":"https://api.github.com/repos/Ramizjon/LearnProjectParquet/issues/1","number":1,"state":"open","locked":false,"title":"Resolved problems with pull request","user":{"login":"Ramizjon","id":3027035,"avatar_url":"https://avatars.githubusercontent.com/u/3027035?v=3","gravatar_id":"","url":"https://api.github.com/users/Ramizjon","html_url":"https://github.com/Ramizjon","followers_url":"https://api.github.com/users/Ramizjon/followers","following_url":"https://api.github.com/users/Ramizjon/following{/other_user}","gists_url":"https://api.github.com/users/Ramizjon/gists{/gist_id}","starred_url":"https://api.github.com/users/Ramizjon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ramizjon/subscriptions","organizations_url":"https://api.github.com/users/Ramizjon/orgs","repos_url":"https://api.github.com/users/Ramizjon/repos","events_url":"https://api.github.com/users/Ramizjon/events{/privacy}","received_events_url":"https://api.github.com/users/Ramizjon/received_events","type":"User","site_admin":false},"body":"@btrofimov new pull request","created_at":"2016-01-04T12:28:30Z","updated_at":"2016-01-26T15:50:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"44c85b2dd127ec7e88e8432511bcfd94bcfbdabb","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Ramizjon/LearnProjectParquet/pulls/1/commits","review_comments_url":"https://api.github.com/repos/Ramizjon/LearnProjectParquet/pulls/1/comments","review_comment_url":"https://api.github.com/repos/Ramizjon/LearnProjectParquet/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Ramizjon/LearnProjectParquet/issues/1/comments","statuses_url":"https://api.github.com/repos/Ramizjon/LearnProjectParquet/statuses/2082700fa674136513ac37b6ed3aeb2a94b6cc46","head":{"label":"Ramizjon:sprintOneCSVCopy","ref":"sprintOneCSVCopy","sha":"2082700fa674136513ac37b6ed3aeb2a94b6cc46","user":{"login":"Ramizjon","id":3027035,"avatar_url":"https://avatars.githubusercontent.com/u/3027035?v=3","gravatar_id":"","url":"https://api.github.com/users/Ramizjon","html_url":"https://github.com/Ramizjon","followers_url":"https://api.github.com/users/Ramizjon/followers","following_url":"https://api.github.com/users/Ramizjon/following{/other_user}","gists_url":"https://api.github.com/users/Ramizjon/gists{/gist_id}","starred_url":"https://api.github.com/users/Ramizjon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ramizjon/subscriptions","organizations_url":"https://api.github.com/users/Ramizjon/orgs","repos_url":"https://api.github.com/users/Ramizjon/repos","events_url":"https://api.github.com/users/Ramizjon/events{/privacy}","received_events_url":"https://api.github.com/users/Ramizjon/received_events","type":"User","site_admin":false},"repo":{"id":48054655,"name":"LearnProjectParquet","full_name":"Ramizjon/LearnProjectParquet","owner":{"login":"Ramizjon","id":3027035,"avatar_url":"https://avatars.githubusercontent.com/u/3027035?v=3","gravatar_id":"","url":"https://api.github.com/users/Ramizjon","html_url":"https://github.com/Ramizjon","followers_url":"https://api.github.com/users/Ramizjon/followers","following_url":"https://api.github.com/users/Ramizjon/following{/other_user}","gists_url":"https://api.github.com/users/Ramizjon/gists{/gist_id}","starred_url":"https://api.github.com/users/Ramizjon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ramizjon/subscriptions","organizations_url":"https://api.github.com/users/Ramizjon/orgs","repos_url":"https://api.github.com/users/Ramizjon/repos","events_url":"https://api.github.com/users/Ramizjon/events{/privacy}","received_events_url":"https://api.github.com/users/Ramizjon/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Ramizjon/LearnProjectParquet","description":"","fork":false,"url":"https://api.github.com/repos/Ramizjon/LearnProjectParquet","forks_url":"https://api.github.com/repos/Ramizjon/LearnProjectParquet/forks","keys_url":"https://api.github.com/repos/Ramizjon/LearnProjectParquet/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Ramizjon/LearnProjectParquet/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Ramizjon/LearnProjectParquet/teams","hooks_url":"https://api.github.com/repos/Ramizjon/LearnProjectParquet/hooks","issue_events_url":"https://api.github.com/repos/Ramizjon/LearnProjectParquet/issues/events{/number}","events_url":"https://api.github.com/repos/Ramizjon/LearnProjectParquet/events","assignees_url":"https://api.github.com/repos/Ramizjon/LearnProjectParquet/assignees{/user}","branches_url":"https://api.github.com/repos/Ramizjon/LearnProjectParquet/branches{/branch}","tags_url":"https://api.github.com/repos/Ramizjon/LearnProjectParquet/tags","blobs_url":"https://api.github.com/repos/Ramizjon/LearnProjectParquet/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Ramizjon/LearnProjectParquet/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Ramizjon/LearnProjectParquet/git/refs{/sha}","trees_url":"https://api.github.com/repos/Ramizjon/LearnProjectParquet/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Ramizjon/LearnProjectParquet/statuses/{sha}","languages_url":"https://api.github.com/repos/Ramizjon/LearnProjectParquet/languages","stargazers_url":"https://api.github.com/repos/Ramizjon/LearnProjectParquet/stargazers","contributors_url":"https://api.github.com/repos/Ramizjon/LearnProjectParquet/contributors","subscribers_url":"https://api.github.com/repos/Ramizjon/LearnProjectParquet/subscribers","subscription_url":"https://api.github.com/repos/Ramizjon/LearnProjectParquet/subscription","commits_url":"https://api.github.com/repos/Ramizjon/LearnProjectParquet/commits{/sha}","git_commits_url":"https://api.github.com/repos/Ramizjon/LearnProjectParquet/git/commits{/sha}","comments_url":"https://api.github.com/repos/Ramizjon/LearnProjectParquet/comments{/number}","issue_comment_url":"https://api.github.com/repos/Ramizjon/LearnProjectParquet/issues/comments{/number}","contents_url":"https://api.github.com/repos/Ramizjon/LearnProjectParquet/contents/{+path}","compare_url":"https://api.github.com/repos/Ramizjon/LearnProjectParquet/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Ramizjon/LearnProjectParquet/merges","archive_url":"https://api.github.com/repos/Ramizjon/LearnProjectParquet/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Ramizjon/LearnProjectParquet/downloads","issues_url":"https://api.github.com/repos/Ramizjon/LearnProjectParquet/issues{/number}","pulls_url":"https://api.github.com/repos/Ramizjon/LearnProjectParquet/pulls{/number}","milestones_url":"https://api.github.com/repos/Ramizjon/LearnProjectParquet/milestones{/number}","notifications_url":"https://api.github.com/repos/Ramizjon/LearnProjectParquet/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Ramizjon/LearnProjectParquet/labels{/name}","releases_url":"https://api.github.com/repos/Ramizjon/LearnProjectParquet/releases{/id}","deployments_url":"https://api.github.com/repos/Ramizjon/LearnProjectParquet/deployments","created_at":"2015-12-15T16:15:12Z","updated_at":"2015-12-15T16:15:12Z","pushed_at":"2016-01-11T16:31:45Z","git_url":"git://github.com/Ramizjon/LearnProjectParquet.git","ssh_url":"git@github.com:Ramizjon/LearnProjectParquet.git","clone_url":"https://github.com/Ramizjon/LearnProjectParquet.git","svn_url":"https://github.com/Ramizjon/LearnProjectParquet","homepage":null,"size":132,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"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":0,"default_branch":"master"}},"base":{"label":"Ramizjon:master","ref":"master","sha":"83f950cd8a0528812329fe2b3b7be866c49c46ae","user":{"login":"Ramizjon","id":3027035,"avatar_url":"https://avatars.githubusercontent.com/u/3027035?v=3","gravatar_id":"","url":"https://api.github.com/users/Ramizjon","html_url":"https://github.com/Ramizjon","followers_url":"https://api.github.com/users/Ramizjon/followers","following_url":"https://api.github.com/users/Ramizjon/following{/other_user}","gists_url":"https://api.github.com/users/Ramizjon/gists{/gist_id}","starred_url":"https://api.github.com/users/Ramizjon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ramizjon/subscriptions","organizations_url":"https://api.github.com/users/Ramizjon/orgs","repos_url":"https://api.github.com/users/Ramizjon/repos","events_url":"https://api.github.com/users/Ramizjon/events{/privacy}","received_events_url":"https://api.github.com/users/Ramizjon/received_events","type":"User","site_admin":false},"repo":{"id":48054655,"name":"LearnProjectParquet","full_name":"Ramizjon/LearnProjectParquet","owner":{"login":"Ramizjon","id":3027035,"avatar_url":"https://avatars.githubusercontent.com/u/3027035?v=3","gravatar_id":"","url":"https://api.github.com/users/Ramizjon","html_url":"https://github.com/Ramizjon","followers_url":"https://api.github.com/users/Ramizjon/followers","following_url":"https://api.github.com/users/Ramizjon/following{/other_user}","gists_url":"https://api.github.com/users/Ramizjon/gists{/gist_id}","starred_url":"https://api.github.com/users/Ramizjon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ramizjon/subscriptions","organizations_url":"https://api.github.com/users/Ramizjon/orgs","repos_url":"https://api.github.com/users/Ramizjon/repos","events_url":"https://api.github.com/users/Ramizjon/events{/privacy}","received_events_url":"https://api.github.com/users/Ramizjon/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Ramizjon/LearnProjectParquet","description":"","fork":false,"url":"https://api.github.com/repos/Ramizjon/LearnProjectParquet","forks_url":"https://api.github.com/repos/Ramizjon/LearnProjectParquet/forks","keys_url":"https://api.github.com/repos/Ramizjon/LearnProjectParquet/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Ramizjon/LearnProjectParquet/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Ramizjon/LearnProjectParquet/teams","hooks_url":"https://api.github.com/repos/Ramizjon/LearnProjectParquet/hooks","issue_events_url":"https://api.github.com/repos/Ramizjon/LearnProjectParquet/issues/events{/number}","events_url":"https://api.github.com/repos/Ramizjon/LearnProjectParquet/events","assignees_url":"https://api.github.com/repos/Ramizjon/LearnProjectParquet/assignees{/user}","branches_url":"https://api.github.com/repos/Ramizjon/LearnProjectParquet/branches{/branch}","tags_url":"https://api.github.com/repos/Ramizjon/LearnProjectParquet/tags","blobs_url":"https://api.github.com/repos/Ramizjon/LearnProjectParquet/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Ramizjon/LearnProjectParquet/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Ramizjon/LearnProjectParquet/git/refs{/sha}","trees_url":"https://api.github.com/repos/Ramizjon/LearnProjectParquet/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Ramizjon/LearnProjectParquet/statuses/{sha}","languages_url":"https://api.github.com/repos/Ramizjon/LearnProjectParquet/languages","stargazers_url":"https://api.github.com/repos/Ramizjon/LearnProjectParquet/stargazers","contributors_url":"https://api.github.com/repos/Ramizjon/LearnProjectParquet/contributors","subscribers_url":"https://api.github.com/repos/Ramizjon/LearnProjectParquet/subscribers","subscription_url":"https://api.github.com/repos/Ramizjon/LearnProjectParquet/subscription","commits_url":"https://api.github.com/repos/Ramizjon/LearnProjectParquet/commits{/sha}","git_commits_url":"https://api.github.com/repos/Ramizjon/LearnProjectParquet/git/commits{/sha}","comments_url":"https://api.github.com/repos/Ramizjon/LearnProjectParquet/comments{/number}","issue_comment_url":"https://api.github.com/repos/Ramizjon/LearnProjectParquet/issues/comments{/number}","contents_url":"https://api.github.com/repos/Ramizjon/LearnProjectParquet/contents/{+path}","compare_url":"https://api.github.com/repos/Ramizjon/LearnProjectParquet/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Ramizjon/LearnProjectParquet/merges","archive_url":"https://api.github.com/repos/Ramizjon/LearnProjectParquet/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Ramizjon/LearnProjectParquet/downloads","issues_url":"https://api.github.com/repos/Ramizjon/LearnProjectParquet/issues{/number}","pulls_url":"https://api.github.com/repos/Ramizjon/LearnProjectParquet/pulls{/number}","milestones_url":"https://api.github.com/repos/Ramizjon/LearnProjectParquet/milestones{/number}","notifications_url":"https://api.github.com/repos/Ramizjon/LearnProjectParquet/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Ramizjon/LearnProjectParquet/labels{/name}","releases_url":"https://api.github.com/repos/Ramizjon/LearnProjectParquet/releases{/id}","deployments_url":"https://api.github.com/repos/Ramizjon/LearnProjectParquet/deployments","created_at":"2015-12-15T16:15:12Z","updated_at":"2015-12-15T16:15:12Z","pushed_at":"2016-01-11T16:31:45Z","git_url":"git://github.com/Ramizjon/LearnProjectParquet.git","ssh_url":"git@github.com:Ramizjon/LearnProjectParquet.git","clone_url":"https://github.com/Ramizjon/LearnProjectParquet.git","svn_url":"https://github.com/Ramizjon/LearnProjectParquet","homepage":null,"size":132,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"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":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Ramizjon/LearnProjectParquet/pulls/1"},"html":{"href":"https://github.com/Ramizjon/LearnProjectParquet/pull/1"},"issue":{"href":"https://api.github.com/repos/Ramizjon/LearnProjectParquet/issues/1"},"comments":{"href":"https://api.github.com/repos/Ramizjon/LearnProjectParquet/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/Ramizjon/LearnProjectParquet/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/Ramizjon/LearnProjectParquet/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Ramizjon/LearnProjectParquet/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/Ramizjon/LearnProjectParquet/statuses/2082700fa674136513ac37b6ed3aeb2a94b6cc46"}}}}