{"action":"created","comment":{"url":"https://api.github.com/repos/apache/phoenix/pulls/comments/49882616","id":49882616,"diff_hunk":"@@ -490,15 +493,37 @@ private static String toString(List<byte[]> gps) {\n         }\n         List<List<Scan>> parallelScans = Lists.newArrayListWithExpectedSize(stopIndex - regionIndex + 1);\n         \n-        byte[] currentKey = startKey;\n-        int guideIndex = currentKey.length == 0 ? 0 : getIndexContainingInclusive(gps, currentKey);\n-        int gpsSize = gps.size();\n+        ImmutableBytesWritable currentKey = new ImmutableBytesWritable(startKey, 0, startKey.length);\n+        \n+        int gpsSize = gps.getGuidePostsCount();\n         int estGuidepostsPerRegion = gpsSize == 0 ? 1 : gpsSize / regionLocations.size() + 1;\n         int keyOffset = 0;\n+        ImmutableBytesWritable currentGuidePost = ByteUtil.EMPTY_IMMUTABLE_BYTE_ARRAY;\n         List<Scan> scans = Lists.newArrayListWithExpectedSize(estGuidepostsPerRegion);\n+        ImmutableBytesWritable guidePosts = gps.getGuidePosts();\n+        ByteArrayInputStream stream = null;\n+        DataInput input = null;\n+        PrefixByteDecoder decoder = null;\n+        int guideIndex = 0;\n+        if (gpsSize > 0) {\n+            stream = new ByteArrayInputStream(guidePosts.get(), guidePosts.getOffset(), guidePosts.getLength());\n+            input = new DataInputStream(stream);\n+            if (gps.getMaxLength() > 0) {\n+                decoder = new PrefixByteDecoder(gps.getMaxLength());\n+            } else {\n+                decoder = new PrefixByteDecoder();\n+            }","path":"phoenix-core/src/main/java/org/apache/phoenix/iterate/BaseResultIterators.java","position":159,"original_position":159,"commit_id":"5ebcd9e2f100ab7eb15452e41ae27be8cbe4070e","original_commit_id":"5ebcd9e2f100ab7eb15452e41ae27be8cbe4070e","user":{"login":"JamesRTaylor","id":6176299,"avatar_url":"https://avatars.githubusercontent.com/u/6176299?v=3","gravatar_id":"","url":"https://api.github.com/users/JamesRTaylor","html_url":"https://github.com/JamesRTaylor","followers_url":"https://api.github.com/users/JamesRTaylor/followers","following_url":"https://api.github.com/users/JamesRTaylor/following{/other_user}","gists_url":"https://api.github.com/users/JamesRTaylor/gists{/gist_id}","starred_url":"https://api.github.com/users/JamesRTaylor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JamesRTaylor/subscriptions","organizations_url":"https://api.github.com/users/JamesRTaylor/orgs","repos_url":"https://api.github.com/users/JamesRTaylor/repos","events_url":"https://api.github.com/users/JamesRTaylor/events{/privacy}","received_events_url":"https://api.github.com/users/JamesRTaylor/received_events","type":"User","site_admin":false},"body":"Instead of this if statement everywhere, just do this (and ensure that PrefixByteDecoder does the right thing if the maxLength is zero):\r\n\r\n    decoder = new PrefixByteDecoder(gps.getMaxLength());","created_at":"2016-01-15T17:49:54Z","updated_at":"2016-01-15T17:49:54Z","html_url":"https://github.com/apache/phoenix/pull/147#discussion_r49882616","pull_request_url":"https://api.github.com/repos/apache/phoenix/pulls/147","_links":{"self":{"href":"https://api.github.com/repos/apache/phoenix/pulls/comments/49882616"},"html":{"href":"https://github.com/apache/phoenix/pull/147#discussion_r49882616"},"pull_request":{"href":"https://api.github.com/repos/apache/phoenix/pulls/147"}}},"pull_request":{"url":"https://api.github.com/repos/apache/phoenix/pulls/147","id":56153403,"html_url":"https://github.com/apache/phoenix/pull/147","diff_url":"https://github.com/apache/phoenix/pull/147.diff","patch_url":"https://github.com/apache/phoenix/pull/147.patch","issue_url":"https://api.github.com/repos/apache/phoenix/issues/147","number":147,"state":"open","locked":false,"title":"PHOENIX-2417 Compress memory used by row key byte[] of guideposts","user":{"login":"ankitsinghal","id":2297609,"avatar_url":"https://avatars.githubusercontent.com/u/2297609?v=3","gravatar_id":"","url":"https://api.github.com/users/ankitsinghal","html_url":"https://github.com/ankitsinghal","followers_url":"https://api.github.com/users/ankitsinghal/followers","following_url":"https://api.github.com/users/ankitsinghal/following{/other_user}","gists_url":"https://api.github.com/users/ankitsinghal/gists{/gist_id}","starred_url":"https://api.github.com/users/ankitsinghal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ankitsinghal/subscriptions","organizations_url":"https://api.github.com/users/ankitsinghal/orgs","repos_url":"https://api.github.com/users/ankitsinghal/repos","events_url":"https://api.github.com/users/ankitsinghal/events{/privacy}","received_events_url":"https://api.github.com/users/ankitsinghal/received_events","type":"User","site_admin":false},"body":"- Still need to tweak some copying of bytes\r\n- Having only these two test case failing currently \r\n    ViewIT.testNonSaltedUpdatableViewWithIndex:129->BaseViewIT.testUpdatableViewWithIndex:85->BaseViewIT.testUpdatableViewIndex:158 expected:<6> but was:<2>\r\n  ViewIT.testNonSaltedUpdatableViewWithIndex:129->BaseViewIT.testUpdatableViewWithIndex:85->BaseViewIT.testUpdatableViewIndex:158 expected:<6> but was:<2>","created_at":"2016-01-15T10:34:33Z","updated_at":"2016-01-15T17:49:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6a91fdbdac67744d07ec21e05aa8510763910192","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/apache/phoenix/pulls/147/commits","review_comments_url":"https://api.github.com/repos/apache/phoenix/pulls/147/comments","review_comment_url":"https://api.github.com/repos/apache/phoenix/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/phoenix/issues/147/comments","statuses_url":"https://api.github.com/repos/apache/phoenix/statuses/5ebcd9e2f100ab7eb15452e41ae27be8cbe4070e","head":{"label":"ankitsinghal:master","ref":"master","sha":"5ebcd9e2f100ab7eb15452e41ae27be8cbe4070e","user":{"login":"ankitsinghal","id":2297609,"avatar_url":"https://avatars.githubusercontent.com/u/2297609?v=3","gravatar_id":"","url":"https://api.github.com/users/ankitsinghal","html_url":"https://github.com/ankitsinghal","followers_url":"https://api.github.com/users/ankitsinghal/followers","following_url":"https://api.github.com/users/ankitsinghal/following{/other_user}","gists_url":"https://api.github.com/users/ankitsinghal/gists{/gist_id}","starred_url":"https://api.github.com/users/ankitsinghal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ankitsinghal/subscriptions","organizations_url":"https://api.github.com/users/ankitsinghal/orgs","repos_url":"https://api.github.com/users/ankitsinghal/repos","events_url":"https://api.github.com/users/ankitsinghal/events{/privacy}","received_events_url":"https://api.github.com/users/ankitsinghal/received_events","type":"User","site_admin":false},"repo":{"id":39274465,"name":"phoenix","full_name":"ankitsinghal/phoenix","owner":{"login":"ankitsinghal","id":2297609,"avatar_url":"https://avatars.githubusercontent.com/u/2297609?v=3","gravatar_id":"","url":"https://api.github.com/users/ankitsinghal","html_url":"https://github.com/ankitsinghal","followers_url":"https://api.github.com/users/ankitsinghal/followers","following_url":"https://api.github.com/users/ankitsinghal/following{/other_user}","gists_url":"https://api.github.com/users/ankitsinghal/gists{/gist_id}","starred_url":"https://api.github.com/users/ankitsinghal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ankitsinghal/subscriptions","organizations_url":"https://api.github.com/users/ankitsinghal/orgs","repos_url":"https://api.github.com/users/ankitsinghal/repos","events_url":"https://api.github.com/users/ankitsinghal/events{/privacy}","received_events_url":"https://api.github.com/users/ankitsinghal/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ankitsinghal/phoenix","description":"Mirror of Apache Phoenix","fork":true,"url":"https://api.github.com/repos/ankitsinghal/phoenix","forks_url":"https://api.github.com/repos/ankitsinghal/phoenix/forks","keys_url":"https://api.github.com/repos/ankitsinghal/phoenix/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ankitsinghal/phoenix/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ankitsinghal/phoenix/teams","hooks_url":"https://api.github.com/repos/ankitsinghal/phoenix/hooks","issue_events_url":"https://api.github.com/repos/ankitsinghal/phoenix/issues/events{/number}","events_url":"https://api.github.com/repos/ankitsinghal/phoenix/events","assignees_url":"https://api.github.com/repos/ankitsinghal/phoenix/assignees{/user}","branches_url":"https://api.github.com/repos/ankitsinghal/phoenix/branches{/branch}","tags_url":"https://api.github.com/repos/ankitsinghal/phoenix/tags","blobs_url":"https://api.github.com/repos/ankitsinghal/phoenix/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ankitsinghal/phoenix/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ankitsinghal/phoenix/git/refs{/sha}","trees_url":"https://api.github.com/repos/ankitsinghal/phoenix/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ankitsinghal/phoenix/statuses/{sha}","languages_url":"https://api.github.com/repos/ankitsinghal/phoenix/languages","stargazers_url":"https://api.github.com/repos/ankitsinghal/phoenix/stargazers","contributors_url":"https://api.github.com/repos/ankitsinghal/phoenix/contributors","subscribers_url":"https://api.github.com/repos/ankitsinghal/phoenix/subscribers","subscription_url":"https://api.github.com/repos/ankitsinghal/phoenix/subscription","commits_url":"https://api.github.com/repos/ankitsinghal/phoenix/commits{/sha}","git_commits_url":"https://api.github.com/repos/ankitsinghal/phoenix/git/commits{/sha}","comments_url":"https://api.github.com/repos/ankitsinghal/phoenix/comments{/number}","issue_comment_url":"https://api.github.com/repos/ankitsinghal/phoenix/issues/comments{/number}","contents_url":"https://api.github.com/repos/ankitsinghal/phoenix/contents/{+path}","compare_url":"https://api.github.com/repos/ankitsinghal/phoenix/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ankitsinghal/phoenix/merges","archive_url":"https://api.github.com/repos/ankitsinghal/phoenix/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ankitsinghal/phoenix/downloads","issues_url":"https://api.github.com/repos/ankitsinghal/phoenix/issues{/number}","pulls_url":"https://api.github.com/repos/ankitsinghal/phoenix/pulls{/number}","milestones_url":"https://api.github.com/repos/ankitsinghal/phoenix/milestones{/number}","notifications_url":"https://api.github.com/repos/ankitsinghal/phoenix/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ankitsinghal/phoenix/labels{/name}","releases_url":"https://api.github.com/repos/ankitsinghal/phoenix/releases{/id}","created_at":"2015-07-17T20:44:22Z","updated_at":"2016-01-15T10:28:46Z","pushed_at":"2016-01-15T10:30:41Z","git_url":"git://github.com/ankitsinghal/phoenix.git","ssh_url":"git@github.com:ankitsinghal/phoenix.git","clone_url":"https://github.com/ankitsinghal/phoenix.git","svn_url":"https://github.com/ankitsinghal/phoenix","homepage":null,"size":21023,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"apache:master","ref":"master","sha":"5818e2d57812e0d19eab2f399ea30b97f9adb112","user":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"repo":{"id":20473418,"name":"phoenix","full_name":"apache/phoenix","owner":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apache/phoenix","description":"Mirror of Apache Phoenix","fork":false,"url":"https://api.github.com/repos/apache/phoenix","forks_url":"https://api.github.com/repos/apache/phoenix/forks","keys_url":"https://api.github.com/repos/apache/phoenix/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/phoenix/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/phoenix/teams","hooks_url":"https://api.github.com/repos/apache/phoenix/hooks","issue_events_url":"https://api.github.com/repos/apache/phoenix/issues/events{/number}","events_url":"https://api.github.com/repos/apache/phoenix/events","assignees_url":"https://api.github.com/repos/apache/phoenix/assignees{/user}","branches_url":"https://api.github.com/repos/apache/phoenix/branches{/branch}","tags_url":"https://api.github.com/repos/apache/phoenix/tags","blobs_url":"https://api.github.com/repos/apache/phoenix/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/phoenix/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/phoenix/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/phoenix/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/phoenix/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/phoenix/languages","stargazers_url":"https://api.github.com/repos/apache/phoenix/stargazers","contributors_url":"https://api.github.com/repos/apache/phoenix/contributors","subscribers_url":"https://api.github.com/repos/apache/phoenix/subscribers","subscription_url":"https://api.github.com/repos/apache/phoenix/subscription","commits_url":"https://api.github.com/repos/apache/phoenix/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/phoenix/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/phoenix/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/phoenix/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/phoenix/contents/{+path}","compare_url":"https://api.github.com/repos/apache/phoenix/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/phoenix/merges","archive_url":"https://api.github.com/repos/apache/phoenix/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/phoenix/downloads","issues_url":"https://api.github.com/repos/apache/phoenix/issues{/number}","pulls_url":"https://api.github.com/repos/apache/phoenix/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/phoenix/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/phoenix/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/phoenix/labels{/name}","releases_url":"https://api.github.com/repos/apache/phoenix/releases{/id}","created_at":"2014-06-04T07:00:08Z","updated_at":"2016-01-13T18:24:27Z","pushed_at":"2016-01-15T14:31:48Z","git_url":"git://github.com/apache/phoenix.git","ssh_url":"git@github.com:apache/phoenix.git","clone_url":"https://github.com/apache/phoenix.git","svn_url":"https://github.com/apache/phoenix","homepage":null,"size":25897,"stargazers_count":140,"watchers_count":140,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":223,"mirror_url":"git://git.apache.org/phoenix.git","open_issues_count":83,"forks":223,"open_issues":83,"watchers":140,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/phoenix/pulls/147"},"html":{"href":"https://github.com/apache/phoenix/pull/147"},"issue":{"href":"https://api.github.com/repos/apache/phoenix/issues/147"},"comments":{"href":"https://api.github.com/repos/apache/phoenix/issues/147/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/phoenix/pulls/147/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/phoenix/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/phoenix/pulls/147/commits"},"statuses":{"href":"https://api.github.com/repos/apache/phoenix/statuses/5ebcd9e2f100ab7eb15452e41ae27be8cbe4070e"}}}}