{"action":"created","comment":{"url":"https://api.github.com/repos/sakshia125/rubix/pulls/comments/81067797","pull_request_review_id":2074680,"id":81067797,"diff_hunk":"@@ -0,0 +1,118 @@\n+/**\n+ * Copyright (c) 2016. Qubole Inc\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+ * http://www.apache.org/licenses/LICENSE-2.0\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. See accompanying LICENSE file.\n+ */\n+package com.qubole.rubix.bookkeeper;\n+\n+/**\n+ * Created by sakshia on 27/9/16.\n+ */\n+\n+import java.io.Closeable;\n+import java.io.IOException;\n+import java.util.List;\n+\n+import com.google.common.base.Throwables;\n+import org.apache.thrift.TException;\n+import org.apache.thrift.protocol.TBinaryProtocol;\n+import org.apache.thrift.transport.TTransportException;\n+import org.slf4j.Logger;\n+import org.slf4j.LoggerFactory;\n+\n+public final class RetryingBookkeeperClient\n+        extends BookKeeperService.Client\n+        implements Closeable\n+{\n+    private static final Logger LOG = LoggerFactory.getLogger(RetryingBookkeeperClient.class);\n+    private int maxRetries;\n+    private BookKeeperClient bookKeeperClient = null;\n+\n+    /**\n+     * List of causes for TTransportException\n+     * ALREADY_OPEN\n+     * END_OF_FILE\n+     * NOT_OPEN\n+     * TIMED_OUT\n+     * type_\n+     * UNKNOWN\n+     */\n+\n+    public RetryingBookkeeperClient(BookKeeperClient client, int maxRetries)\n+    {\n+        super(new TBinaryProtocol(client.transport));\n+        this.bookKeeperClient = client;\n+        this.maxRetries = maxRetries;\n+    }\n+\n+    @Override\n+    public List<Location> getCacheStatus(String remotePath, long fileLength, long lastModified, long startBlock, long endBlock, int clusterType)\n+    {\n+        try {\n+            return super.getCacheStatus(remotePath, fileLength, lastModified, startBlock, endBlock, clusterType);\n+        }\n+        catch (TException e) {\n+            try {\n+                retryConnection();\n+                return super.getCacheStatus(remotePath, fileLength, lastModified, startBlock, endBlock, clusterType);\n+            }\n+            catch (TException e1) {\n+                LOG.info(\"Could not get cache status from server \" + Throwables.getStackTraceAsString(e));\n+            }\n+        }\n+        return null;\n+    }\n+\n+    @Override\n+    public void setAllCached(String remotePath, long fileLength, long lastModified, long startBlock, long endBlock)\n+    {\n+        try {\n+            super.setAllCached(remotePath, fileLength, lastModified, startBlock, endBlock);","path":"rubix-bookkeeper/src/main/java/com/qubole/rubix/bookkeeper/RetryingBookkeeperClient.java","position":77,"original_position":77,"commit_id":"ba5dba05814b6a68683e1a9bab7d03b5ba66a0a1","original_commit_id":"ba5dba05814b6a68683e1a9bab7d03b5ba66a0a1","user":{"login":"stagraqubole","id":7426795,"avatar_url":"https://avatars.githubusercontent.com/u/7426795?v=3","gravatar_id":"","url":"https://api.github.com/users/stagraqubole","html_url":"https://github.com/stagraqubole","followers_url":"https://api.github.com/users/stagraqubole/followers","following_url":"https://api.github.com/users/stagraqubole/following{/other_user}","gists_url":"https://api.github.com/users/stagraqubole/gists{/gist_id}","starred_url":"https://api.github.com/users/stagraqubole/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stagraqubole/subscriptions","organizations_url":"https://api.github.com/users/stagraqubole/orgs","repos_url":"https://api.github.com/users/stagraqubole/repos","events_url":"https://api.github.com/users/stagraqubole/events{/privacy}","received_events_url":"https://api.github.com/users/stagraqubole/received_events","type":"User","site_admin":false},"body":"Same","created_at":"2016-09-29T05:41:23Z","updated_at":"2016-09-29T05:47:48Z","html_url":"https://github.com/sakshia125/rubix/pull/1#discussion_r81067797","pull_request_url":"https://api.github.com/repos/sakshia125/rubix/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/sakshia125/rubix/pulls/comments/81067797"},"html":{"href":"https://github.com/sakshia125/rubix/pull/1#discussion_r81067797"},"pull_request":{"href":"https://api.github.com/repos/sakshia125/rubix/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/sakshia125/rubix/pulls/1","id":87247841,"html_url":"https://github.com/sakshia125/rubix/pull/1","diff_url":"https://github.com/sakshia125/rubix/pull/1.diff","patch_url":"https://github.com/sakshia125/rubix/pull/1.patch","issue_url":"https://api.github.com/repos/sakshia125/rubix/issues/1","number":1,"state":"open","locked":false,"title":"Thrift timeout","user":{"login":"sakshia125","id":20456243,"avatar_url":"https://avatars.githubusercontent.com/u/20456243?v=3","gravatar_id":"","url":"https://api.github.com/users/sakshia125","html_url":"https://github.com/sakshia125","followers_url":"https://api.github.com/users/sakshia125/followers","following_url":"https://api.github.com/users/sakshia125/following{/other_user}","gists_url":"https://api.github.com/users/sakshia125/gists{/gist_id}","starred_url":"https://api.github.com/users/sakshia125/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sakshia125/subscriptions","organizations_url":"https://api.github.com/users/sakshia125/orgs","repos_url":"https://api.github.com/users/sakshia125/repos","events_url":"https://api.github.com/users/sakshia125/events{/privacy}","received_events_url":"https://api.github.com/users/sakshia125/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-09-29T05:18:54Z","updated_at":"2016-09-29T05:47:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ba7a741744ee8c1519f55566694434d32b31d6bd","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/sakshia125/rubix/pulls/1/commits","review_comments_url":"https://api.github.com/repos/sakshia125/rubix/pulls/1/comments","review_comment_url":"https://api.github.com/repos/sakshia125/rubix/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sakshia125/rubix/issues/1/comments","statuses_url":"https://api.github.com/repos/sakshia125/rubix/statuses/ba5dba05814b6a68683e1a9bab7d03b5ba66a0a1","head":{"label":"sakshia125:thrift-timeout","ref":"thrift-timeout","sha":"ba5dba05814b6a68683e1a9bab7d03b5ba66a0a1","user":{"login":"sakshia125","id":20456243,"avatar_url":"https://avatars.githubusercontent.com/u/20456243?v=3","gravatar_id":"","url":"https://api.github.com/users/sakshia125","html_url":"https://github.com/sakshia125","followers_url":"https://api.github.com/users/sakshia125/followers","following_url":"https://api.github.com/users/sakshia125/following{/other_user}","gists_url":"https://api.github.com/users/sakshia125/gists{/gist_id}","starred_url":"https://api.github.com/users/sakshia125/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sakshia125/subscriptions","organizations_url":"https://api.github.com/users/sakshia125/orgs","repos_url":"https://api.github.com/users/sakshia125/repos","events_url":"https://api.github.com/users/sakshia125/events{/privacy}","received_events_url":"https://api.github.com/users/sakshia125/received_events","type":"User","site_admin":false},"repo":{"id":63324312,"name":"rubix","full_name":"sakshia125/rubix","owner":{"login":"sakshia125","id":20456243,"avatar_url":"https://avatars.githubusercontent.com/u/20456243?v=3","gravatar_id":"","url":"https://api.github.com/users/sakshia125","html_url":"https://github.com/sakshia125","followers_url":"https://api.github.com/users/sakshia125/followers","following_url":"https://api.github.com/users/sakshia125/following{/other_user}","gists_url":"https://api.github.com/users/sakshia125/gists{/gist_id}","starred_url":"https://api.github.com/users/sakshia125/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sakshia125/subscriptions","organizations_url":"https://api.github.com/users/sakshia125/orgs","repos_url":"https://api.github.com/users/sakshia125/repos","events_url":"https://api.github.com/users/sakshia125/events{/privacy}","received_events_url":"https://api.github.com/users/sakshia125/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sakshia125/rubix","description":"Cache File System optimized for columnar formats and object stores ","fork":true,"url":"https://api.github.com/repos/sakshia125/rubix","forks_url":"https://api.github.com/repos/sakshia125/rubix/forks","keys_url":"https://api.github.com/repos/sakshia125/rubix/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sakshia125/rubix/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sakshia125/rubix/teams","hooks_url":"https://api.github.com/repos/sakshia125/rubix/hooks","issue_events_url":"https://api.github.com/repos/sakshia125/rubix/issues/events{/number}","events_url":"https://api.github.com/repos/sakshia125/rubix/events","assignees_url":"https://api.github.com/repos/sakshia125/rubix/assignees{/user}","branches_url":"https://api.github.com/repos/sakshia125/rubix/branches{/branch}","tags_url":"https://api.github.com/repos/sakshia125/rubix/tags","blobs_url":"https://api.github.com/repos/sakshia125/rubix/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sakshia125/rubix/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sakshia125/rubix/git/refs{/sha}","trees_url":"https://api.github.com/repos/sakshia125/rubix/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sakshia125/rubix/statuses/{sha}","languages_url":"https://api.github.com/repos/sakshia125/rubix/languages","stargazers_url":"https://api.github.com/repos/sakshia125/rubix/stargazers","contributors_url":"https://api.github.com/repos/sakshia125/rubix/contributors","subscribers_url":"https://api.github.com/repos/sakshia125/rubix/subscribers","subscription_url":"https://api.github.com/repos/sakshia125/rubix/subscription","commits_url":"https://api.github.com/repos/sakshia125/rubix/commits{/sha}","git_commits_url":"https://api.github.com/repos/sakshia125/rubix/git/commits{/sha}","comments_url":"https://api.github.com/repos/sakshia125/rubix/comments{/number}","issue_comment_url":"https://api.github.com/repos/sakshia125/rubix/issues/comments{/number}","contents_url":"https://api.github.com/repos/sakshia125/rubix/contents/{+path}","compare_url":"https://api.github.com/repos/sakshia125/rubix/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sakshia125/rubix/merges","archive_url":"https://api.github.com/repos/sakshia125/rubix/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sakshia125/rubix/downloads","issues_url":"https://api.github.com/repos/sakshia125/rubix/issues{/number}","pulls_url":"https://api.github.com/repos/sakshia125/rubix/pulls{/number}","milestones_url":"https://api.github.com/repos/sakshia125/rubix/milestones{/number}","notifications_url":"https://api.github.com/repos/sakshia125/rubix/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sakshia125/rubix/labels{/name}","releases_url":"https://api.github.com/repos/sakshia125/rubix/releases{/id}","deployments_url":"https://api.github.com/repos/sakshia125/rubix/deployments","created_at":"2016-07-14T09:52:48Z","updated_at":"2016-07-14T09:52:49Z","pushed_at":"2016-09-29T05:18:54Z","git_url":"git://github.com/sakshia125/rubix.git","ssh_url":"git@github.com:sakshia125/rubix.git","clone_url":"https://github.com/sakshia125/rubix.git","svn_url":"https://github.com/sakshia125/rubix","homepage":null,"size":175,"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":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"sakshia125:non-local1","ref":"non-local1","sha":"6492883b69efa19bcbd11e717c718be3b5b98f3d","user":{"login":"sakshia125","id":20456243,"avatar_url":"https://avatars.githubusercontent.com/u/20456243?v=3","gravatar_id":"","url":"https://api.github.com/users/sakshia125","html_url":"https://github.com/sakshia125","followers_url":"https://api.github.com/users/sakshia125/followers","following_url":"https://api.github.com/users/sakshia125/following{/other_user}","gists_url":"https://api.github.com/users/sakshia125/gists{/gist_id}","starred_url":"https://api.github.com/users/sakshia125/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sakshia125/subscriptions","organizations_url":"https://api.github.com/users/sakshia125/orgs","repos_url":"https://api.github.com/users/sakshia125/repos","events_url":"https://api.github.com/users/sakshia125/events{/privacy}","received_events_url":"https://api.github.com/users/sakshia125/received_events","type":"User","site_admin":false},"repo":{"id":63324312,"name":"rubix","full_name":"sakshia125/rubix","owner":{"login":"sakshia125","id":20456243,"avatar_url":"https://avatars.githubusercontent.com/u/20456243?v=3","gravatar_id":"","url":"https://api.github.com/users/sakshia125","html_url":"https://github.com/sakshia125","followers_url":"https://api.github.com/users/sakshia125/followers","following_url":"https://api.github.com/users/sakshia125/following{/other_user}","gists_url":"https://api.github.com/users/sakshia125/gists{/gist_id}","starred_url":"https://api.github.com/users/sakshia125/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sakshia125/subscriptions","organizations_url":"https://api.github.com/users/sakshia125/orgs","repos_url":"https://api.github.com/users/sakshia125/repos","events_url":"https://api.github.com/users/sakshia125/events{/privacy}","received_events_url":"https://api.github.com/users/sakshia125/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sakshia125/rubix","description":"Cache File System optimized for columnar formats and object stores ","fork":true,"url":"https://api.github.com/repos/sakshia125/rubix","forks_url":"https://api.github.com/repos/sakshia125/rubix/forks","keys_url":"https://api.github.com/repos/sakshia125/rubix/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sakshia125/rubix/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sakshia125/rubix/teams","hooks_url":"https://api.github.com/repos/sakshia125/rubix/hooks","issue_events_url":"https://api.github.com/repos/sakshia125/rubix/issues/events{/number}","events_url":"https://api.github.com/repos/sakshia125/rubix/events","assignees_url":"https://api.github.com/repos/sakshia125/rubix/assignees{/user}","branches_url":"https://api.github.com/repos/sakshia125/rubix/branches{/branch}","tags_url":"https://api.github.com/repos/sakshia125/rubix/tags","blobs_url":"https://api.github.com/repos/sakshia125/rubix/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sakshia125/rubix/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sakshia125/rubix/git/refs{/sha}","trees_url":"https://api.github.com/repos/sakshia125/rubix/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sakshia125/rubix/statuses/{sha}","languages_url":"https://api.github.com/repos/sakshia125/rubix/languages","stargazers_url":"https://api.github.com/repos/sakshia125/rubix/stargazers","contributors_url":"https://api.github.com/repos/sakshia125/rubix/contributors","subscribers_url":"https://api.github.com/repos/sakshia125/rubix/subscribers","subscription_url":"https://api.github.com/repos/sakshia125/rubix/subscription","commits_url":"https://api.github.com/repos/sakshia125/rubix/commits{/sha}","git_commits_url":"https://api.github.com/repos/sakshia125/rubix/git/commits{/sha}","comments_url":"https://api.github.com/repos/sakshia125/rubix/comments{/number}","issue_comment_url":"https://api.github.com/repos/sakshia125/rubix/issues/comments{/number}","contents_url":"https://api.github.com/repos/sakshia125/rubix/contents/{+path}","compare_url":"https://api.github.com/repos/sakshia125/rubix/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sakshia125/rubix/merges","archive_url":"https://api.github.com/repos/sakshia125/rubix/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sakshia125/rubix/downloads","issues_url":"https://api.github.com/repos/sakshia125/rubix/issues{/number}","pulls_url":"https://api.github.com/repos/sakshia125/rubix/pulls{/number}","milestones_url":"https://api.github.com/repos/sakshia125/rubix/milestones{/number}","notifications_url":"https://api.github.com/repos/sakshia125/rubix/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sakshia125/rubix/labels{/name}","releases_url":"https://api.github.com/repos/sakshia125/rubix/releases{/id}","deployments_url":"https://api.github.com/repos/sakshia125/rubix/deployments","created_at":"2016-07-14T09:52:48Z","updated_at":"2016-07-14T09:52:49Z","pushed_at":"2016-09-29T05:18:54Z","git_url":"git://github.com/sakshia125/rubix.git","ssh_url":"git@github.com:sakshia125/rubix.git","clone_url":"https://github.com/sakshia125/rubix.git","svn_url":"https://github.com/sakshia125/rubix","homepage":null,"size":175,"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":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/sakshia125/rubix/pulls/1"},"html":{"href":"https://github.com/sakshia125/rubix/pull/1"},"issue":{"href":"https://api.github.com/repos/sakshia125/rubix/issues/1"},"comments":{"href":"https://api.github.com/repos/sakshia125/rubix/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/sakshia125/rubix/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/sakshia125/rubix/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sakshia125/rubix/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/sakshia125/rubix/statuses/ba5dba05814b6a68683e1a9bab7d03b5ba66a0a1"}}}}
{"actor":{"display_login":"stagraqubole"}}