{"action":"created","comment":{"url":"https://api.github.com/repos/ehcache/ehcache3/pulls/comments/63841026","id":63841026,"diff_hunk":"@@ -0,0 +1,130 @@\n+/*\n+ * Copyright Terracotta, Inc.\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 org.ehcache.clustered.common.messages;\n+\n+\n+import java.nio.ByteBuffer;\n+import java.nio.charset.Charset;\n+\n+import static org.ehcache.clustered.common.messages.ServerStoreOpMessage.AppendMessage;\n+import static org.ehcache.clustered.common.messages.ServerStoreOpMessage.GetAndAppendMessage;\n+import static org.ehcache.clustered.common.messages.ServerStoreOpMessage.ReplaceAtHeadMessage;\n+\n+/**\n+ *\n+ */\n+public class ServerStoreOpCodec {\n+\n+  private static final Charset UTF_8 = Charset.forName(\"UTF-8\");\n+\n+  private static final byte MSG_TYPE_OFFSET = 1;\n+  private static final byte STORE_OP_CODE_OFFSET = 1;\n+  private static final byte CACHE_ID_LEN_OFFSET = 4;\n+  private static final byte KEY_OFFSET = 8;\n+  private static final byte CHAIN_LEN_OFFSET = 4;\n+\n+  public static byte[] encode(ServerStoreOpMessage message) {","path":"clustered/common/src/main/java/org/ehcache/clustered/common/messages/ServerStoreOpCodec.java","position":39,"original_position":39,"commit_id":"8333daadad523d933cb4d3c8dd7b63573dc170e2","original_commit_id":"8333daadad523d933cb4d3c8dd7b63573dc170e2","user":{"login":"AbfrmBlr","id":4498935,"avatar_url":"https://avatars.githubusercontent.com/u/4498935?v=3","gravatar_id":"","url":"https://api.github.com/users/AbfrmBlr","html_url":"https://github.com/AbfrmBlr","followers_url":"https://api.github.com/users/AbfrmBlr/followers","following_url":"https://api.github.com/users/AbfrmBlr/following{/other_user}","gists_url":"https://api.github.com/users/AbfrmBlr/gists{/gist_id}","starred_url":"https://api.github.com/users/AbfrmBlr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AbfrmBlr/subscriptions","organizations_url":"https://api.github.com/users/AbfrmBlr/orgs","repos_url":"https://api.github.com/users/AbfrmBlr/repos","events_url":"https://api.github.com/users/AbfrmBlr/events{/privacy}","received_events_url":"https://api.github.com/users/AbfrmBlr/received_events","type":"User","site_admin":false},"body":"Had a discussion with @albinsuresh @rkavanap @itsroshan & sairam and no one seems to like this switch/case thing. This needs refactoring.","created_at":"2016-05-19T08:37:09Z","updated_at":"2016-05-19T08:37:09Z","html_url":"https://github.com/ehcache/ehcache3/pull/1050#discussion_r63841026","pull_request_url":"https://api.github.com/repos/ehcache/ehcache3/pulls/1050","_links":{"self":{"href":"https://api.github.com/repos/ehcache/ehcache3/pulls/comments/63841026"},"html":{"href":"https://github.com/ehcache/ehcache3/pull/1050#discussion_r63841026"},"pull_request":{"href":"https://api.github.com/repos/ehcache/ehcache3/pulls/1050"}}},"pull_request":{"url":"https://api.github.com/repos/ehcache/ehcache3/pulls/1050","id":69986097,"html_url":"https://github.com/ehcache/ehcache3/pull/1050","diff_url":"https://github.com/ehcache/ehcache3/pull/1050.diff","patch_url":"https://github.com/ehcache/ehcache3/pull/1050.patch","issue_url":"https://api.github.com/repos/ehcache/ehcache3/issues/1050","number":1050,"state":"open","locked":false,"title":"Issue 994","user":{"login":"AbfrmBlr","id":4498935,"avatar_url":"https://avatars.githubusercontent.com/u/4498935?v=3","gravatar_id":"","url":"https://api.github.com/users/AbfrmBlr","html_url":"https://github.com/AbfrmBlr","followers_url":"https://api.github.com/users/AbfrmBlr/followers","following_url":"https://api.github.com/users/AbfrmBlr/following{/other_user}","gists_url":"https://api.github.com/users/AbfrmBlr/gists{/gist_id}","starred_url":"https://api.github.com/users/AbfrmBlr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AbfrmBlr/subscriptions","organizations_url":"https://api.github.com/users/AbfrmBlr/orgs","repos_url":"https://api.github.com/users/AbfrmBlr/repos","events_url":"https://api.github.com/users/AbfrmBlr/events{/privacy}","received_events_url":"https://api.github.com/users/AbfrmBlr/received_events","type":"User","site_admin":false},"body":"This can be merged if found ok.\r\nThe work that follows this PR is \r\n\r\n- Op specific Codec integration in `EhcacheCodec`\r\n- tests\r\n- `ClusteredStore` clean up regarding to `underlyingStore`.(not very sure about it though)","created_at":"2016-05-13T12:13:30Z","updated_at":"2016-05-19T08:37:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2cedc1a03c4b29eef914a11fafb947efd9b80bd6","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ehcache/ehcache3/pulls/1050/commits","review_comments_url":"https://api.github.com/repos/ehcache/ehcache3/pulls/1050/comments","review_comment_url":"https://api.github.com/repos/ehcache/ehcache3/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ehcache/ehcache3/issues/1050/comments","statuses_url":"https://api.github.com/repos/ehcache/ehcache3/statuses/8333daadad523d933cb4d3c8dd7b63573dc170e2","head":{"label":"AbfrmBlr:issue-994","ref":"issue-994","sha":"8333daadad523d933cb4d3c8dd7b63573dc170e2","user":{"login":"AbfrmBlr","id":4498935,"avatar_url":"https://avatars.githubusercontent.com/u/4498935?v=3","gravatar_id":"","url":"https://api.github.com/users/AbfrmBlr","html_url":"https://github.com/AbfrmBlr","followers_url":"https://api.github.com/users/AbfrmBlr/followers","following_url":"https://api.github.com/users/AbfrmBlr/following{/other_user}","gists_url":"https://api.github.com/users/AbfrmBlr/gists{/gist_id}","starred_url":"https://api.github.com/users/AbfrmBlr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AbfrmBlr/subscriptions","organizations_url":"https://api.github.com/users/AbfrmBlr/orgs","repos_url":"https://api.github.com/users/AbfrmBlr/repos","events_url":"https://api.github.com/users/AbfrmBlr/events{/privacy}","received_events_url":"https://api.github.com/users/AbfrmBlr/received_events","type":"User","site_admin":false},"repo":{"id":28589092,"name":"ehcache3","full_name":"AbfrmBlr/ehcache3","owner":{"login":"AbfrmBlr","id":4498935,"avatar_url":"https://avatars.githubusercontent.com/u/4498935?v=3","gravatar_id":"","url":"https://api.github.com/users/AbfrmBlr","html_url":"https://github.com/AbfrmBlr","followers_url":"https://api.github.com/users/AbfrmBlr/followers","following_url":"https://api.github.com/users/AbfrmBlr/following{/other_user}","gists_url":"https://api.github.com/users/AbfrmBlr/gists{/gist_id}","starred_url":"https://api.github.com/users/AbfrmBlr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AbfrmBlr/subscriptions","organizations_url":"https://api.github.com/users/AbfrmBlr/orgs","repos_url":"https://api.github.com/users/AbfrmBlr/repos","events_url":"https://api.github.com/users/AbfrmBlr/events{/privacy}","received_events_url":"https://api.github.com/users/AbfrmBlr/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/AbfrmBlr/ehcache3","description":"Ehcache 3.x line ","fork":true,"url":"https://api.github.com/repos/AbfrmBlr/ehcache3","forks_url":"https://api.github.com/repos/AbfrmBlr/ehcache3/forks","keys_url":"https://api.github.com/repos/AbfrmBlr/ehcache3/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AbfrmBlr/ehcache3/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AbfrmBlr/ehcache3/teams","hooks_url":"https://api.github.com/repos/AbfrmBlr/ehcache3/hooks","issue_events_url":"https://api.github.com/repos/AbfrmBlr/ehcache3/issues/events{/number}","events_url":"https://api.github.com/repos/AbfrmBlr/ehcache3/events","assignees_url":"https://api.github.com/repos/AbfrmBlr/ehcache3/assignees{/user}","branches_url":"https://api.github.com/repos/AbfrmBlr/ehcache3/branches{/branch}","tags_url":"https://api.github.com/repos/AbfrmBlr/ehcache3/tags","blobs_url":"https://api.github.com/repos/AbfrmBlr/ehcache3/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AbfrmBlr/ehcache3/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AbfrmBlr/ehcache3/git/refs{/sha}","trees_url":"https://api.github.com/repos/AbfrmBlr/ehcache3/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AbfrmBlr/ehcache3/statuses/{sha}","languages_url":"https://api.github.com/repos/AbfrmBlr/ehcache3/languages","stargazers_url":"https://api.github.com/repos/AbfrmBlr/ehcache3/stargazers","contributors_url":"https://api.github.com/repos/AbfrmBlr/ehcache3/contributors","subscribers_url":"https://api.github.com/repos/AbfrmBlr/ehcache3/subscribers","subscription_url":"https://api.github.com/repos/AbfrmBlr/ehcache3/subscription","commits_url":"https://api.github.com/repos/AbfrmBlr/ehcache3/commits{/sha}","git_commits_url":"https://api.github.com/repos/AbfrmBlr/ehcache3/git/commits{/sha}","comments_url":"https://api.github.com/repos/AbfrmBlr/ehcache3/comments{/number}","issue_comment_url":"https://api.github.com/repos/AbfrmBlr/ehcache3/issues/comments{/number}","contents_url":"https://api.github.com/repos/AbfrmBlr/ehcache3/contents/{+path}","compare_url":"https://api.github.com/repos/AbfrmBlr/ehcache3/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AbfrmBlr/ehcache3/merges","archive_url":"https://api.github.com/repos/AbfrmBlr/ehcache3/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AbfrmBlr/ehcache3/downloads","issues_url":"https://api.github.com/repos/AbfrmBlr/ehcache3/issues{/number}","pulls_url":"https://api.github.com/repos/AbfrmBlr/ehcache3/pulls{/number}","milestones_url":"https://api.github.com/repos/AbfrmBlr/ehcache3/milestones{/number}","notifications_url":"https://api.github.com/repos/AbfrmBlr/ehcache3/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AbfrmBlr/ehcache3/labels{/name}","releases_url":"https://api.github.com/repos/AbfrmBlr/ehcache3/releases{/id}","deployments_url":"https://api.github.com/repos/AbfrmBlr/ehcache3/deployments","created_at":"2014-12-29T10:47:44Z","updated_at":"2016-01-19T07:22:30Z","pushed_at":"2016-05-19T07:58:14Z","git_url":"git://github.com/AbfrmBlr/ehcache3.git","ssh_url":"git@github.com:AbfrmBlr/ehcache3.git","clone_url":"https://github.com/AbfrmBlr/ehcache3.git","svn_url":"https://github.com/AbfrmBlr/ehcache3","homepage":"ehcache.org","size":9263,"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":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ehcache:master","ref":"master","sha":"1d6be02c174d9392572a5495523aba6c0812bcd7","user":{"login":"ehcache","id":5504982,"avatar_url":"https://avatars.githubusercontent.com/u/5504982?v=3","gravatar_id":"","url":"https://api.github.com/users/ehcache","html_url":"https://github.com/ehcache","followers_url":"https://api.github.com/users/ehcache/followers","following_url":"https://api.github.com/users/ehcache/following{/other_user}","gists_url":"https://api.github.com/users/ehcache/gists{/gist_id}","starred_url":"https://api.github.com/users/ehcache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ehcache/subscriptions","organizations_url":"https://api.github.com/users/ehcache/orgs","repos_url":"https://api.github.com/users/ehcache/repos","events_url":"https://api.github.com/users/ehcache/events{/privacy}","received_events_url":"https://api.github.com/users/ehcache/received_events","type":"Organization","site_admin":false},"repo":{"id":17224514,"name":"ehcache3","full_name":"ehcache/ehcache3","owner":{"login":"ehcache","id":5504982,"avatar_url":"https://avatars.githubusercontent.com/u/5504982?v=3","gravatar_id":"","url":"https://api.github.com/users/ehcache","html_url":"https://github.com/ehcache","followers_url":"https://api.github.com/users/ehcache/followers","following_url":"https://api.github.com/users/ehcache/following{/other_user}","gists_url":"https://api.github.com/users/ehcache/gists{/gist_id}","starred_url":"https://api.github.com/users/ehcache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ehcache/subscriptions","organizations_url":"https://api.github.com/users/ehcache/orgs","repos_url":"https://api.github.com/users/ehcache/repos","events_url":"https://api.github.com/users/ehcache/events{/privacy}","received_events_url":"https://api.github.com/users/ehcache/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ehcache/ehcache3","description":"Ehcache 3.x line ","fork":false,"url":"https://api.github.com/repos/ehcache/ehcache3","forks_url":"https://api.github.com/repos/ehcache/ehcache3/forks","keys_url":"https://api.github.com/repos/ehcache/ehcache3/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ehcache/ehcache3/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ehcache/ehcache3/teams","hooks_url":"https://api.github.com/repos/ehcache/ehcache3/hooks","issue_events_url":"https://api.github.com/repos/ehcache/ehcache3/issues/events{/number}","events_url":"https://api.github.com/repos/ehcache/ehcache3/events","assignees_url":"https://api.github.com/repos/ehcache/ehcache3/assignees{/user}","branches_url":"https://api.github.com/repos/ehcache/ehcache3/branches{/branch}","tags_url":"https://api.github.com/repos/ehcache/ehcache3/tags","blobs_url":"https://api.github.com/repos/ehcache/ehcache3/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ehcache/ehcache3/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ehcache/ehcache3/git/refs{/sha}","trees_url":"https://api.github.com/repos/ehcache/ehcache3/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ehcache/ehcache3/statuses/{sha}","languages_url":"https://api.github.com/repos/ehcache/ehcache3/languages","stargazers_url":"https://api.github.com/repos/ehcache/ehcache3/stargazers","contributors_url":"https://api.github.com/repos/ehcache/ehcache3/contributors","subscribers_url":"https://api.github.com/repos/ehcache/ehcache3/subscribers","subscription_url":"https://api.github.com/repos/ehcache/ehcache3/subscription","commits_url":"https://api.github.com/repos/ehcache/ehcache3/commits{/sha}","git_commits_url":"https://api.github.com/repos/ehcache/ehcache3/git/commits{/sha}","comments_url":"https://api.github.com/repos/ehcache/ehcache3/comments{/number}","issue_comment_url":"https://api.github.com/repos/ehcache/ehcache3/issues/comments{/number}","contents_url":"https://api.github.com/repos/ehcache/ehcache3/contents/{+path}","compare_url":"https://api.github.com/repos/ehcache/ehcache3/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ehcache/ehcache3/merges","archive_url":"https://api.github.com/repos/ehcache/ehcache3/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ehcache/ehcache3/downloads","issues_url":"https://api.github.com/repos/ehcache/ehcache3/issues{/number}","pulls_url":"https://api.github.com/repos/ehcache/ehcache3/pulls{/number}","milestones_url":"https://api.github.com/repos/ehcache/ehcache3/milestones{/number}","notifications_url":"https://api.github.com/repos/ehcache/ehcache3/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ehcache/ehcache3/labels{/name}","releases_url":"https://api.github.com/repos/ehcache/ehcache3/releases{/id}","deployments_url":"https://api.github.com/repos/ehcache/ehcache3/deployments","created_at":"2014-02-26T20:39:16Z","updated_at":"2016-05-18T14:42:26Z","pushed_at":"2016-05-19T08:03:32Z","git_url":"git://github.com/ehcache/ehcache3.git","ssh_url":"git@github.com:ehcache/ehcache3.git","clone_url":"https://github.com/ehcache/ehcache3.git","svn_url":"https://github.com/ehcache/ehcache3","homepage":"http://www.ehcache.org","size":11225,"stargazers_count":394,"watchers_count":394,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":208,"mirror_url":null,"open_issues_count":76,"forks":208,"open_issues":76,"watchers":394,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ehcache/ehcache3/pulls/1050"},"html":{"href":"https://github.com/ehcache/ehcache3/pull/1050"},"issue":{"href":"https://api.github.com/repos/ehcache/ehcache3/issues/1050"},"comments":{"href":"https://api.github.com/repos/ehcache/ehcache3/issues/1050/comments"},"review_comments":{"href":"https://api.github.com/repos/ehcache/ehcache3/pulls/1050/comments"},"review_comment":{"href":"https://api.github.com/repos/ehcache/ehcache3/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ehcache/ehcache3/pulls/1050/commits"},"statuses":{"href":"https://api.github.com/repos/ehcache/ehcache3/statuses/8333daadad523d933cb4d3c8dd7b63573dc170e2"}}}}