{"action":"created","comment":{"url":"https://api.github.com/repos/naver/arcus-java-client/pulls/comments/51231732","id":51231732,"diff_hunk":"@@ -674,4 +682,80 @@ public String getStatus() {\n \t\tsb.append(\" #TR=\").append(getTimeoutRatioNow());\n \t\treturn sb.toString();\n \t}\n+\t/* ENABLE_REPLICATION if */\n+\t/* WHCHOI83_MEMCACHED_REPLICA_GROUP if */\n+\n+\tpublic void setReplicaGroup(MemcachedReplicaGroup g) {\n+\t\treplicaGroup = g;\n+\t}\n+\n+\tpublic MemcachedReplicaGroup getReplicaGroup() {\n+\t\treturn replicaGroup;\n+\t}\n+\n+\tpublic List<Operation> getAllOperations() {\n+\t\tList<Operation> allOp = new ArrayList<Operation>();\n+\n+\t\tif (hasReadOp()) {\n+\t\t\treadQ.drainTo(allOp);\n+\t\t}\n+\n+\t\twhile (hasWriteOp()) {\n+\t\t\t/* large byte operation\n+\t\t\t * may exist write queue & read queue\n+\t\t\t */\n+\t\t\tOperation op = removeCurrentWriteOp();\n+\t\t\tif (!allOp.contains(op)) {\n+\t\t\t\tallOp.add(op);\n+\t\t\t} else {\n+\t\t\t\tgetLogger().warn(\"Duplicate operation exist in \" + this + \" : \" + op);\n+\t\t\t}\n+\t\t}\n+\n+\t\tif (inputQueue.size() > 0) {\n+\t\t\tinputQueue.drainTo(allOp);\n+\t\t}\n+\n+\t\treturn allOp;\n+\t}\n+\n+\tpublic void addAllToInputQ(List<Operation> allOp, boolean self) {\n+\t\tfor (Operation op : allOp) {\n+\t\t\tif (!self)\n+\t\t\t\tgetLogger().debug(\"input operation(\" + op + \" - \" + op.getState() + \") at \" + this);\n+\n+\t\t\tif (op.getState() == OperationState.WRITING && op.getBuffer() != null) {\n+\t\t\t\top.getBuffer().reset(); // buffer offset reset\n+\t\t\t} else {\n+\t\t\t\top.initialize(); // write completed or not yet initialized\n+\t\t\t}\n+\n+\t\t\tif (!self) {\n+\t\t\t\top.resetState();\n+\t\t\t\top.setHandlingNode(this);\n+\t\t\t\top.setMoved(true);\n+\t\t\t} else {\n+\t\t\t\top.resetState();\n+\t\t\t}\n+\t\t}\n+\t\tinputQueue.addAll(allOp);\n+\n+\t\tif (self) {\n+\t\t\tgetWbuf().clear();\n+\t\t\tgetRbuf().clear();\n+\t\t\ttoWrite=0;\n+\t\t}\n+\t}\n+\n+\tpublic int moveOperations(final MemcachedNode toNode) {\n+\t\tList<Operation> allOp = getAllOperations();","path":"src/main/java/net/spy/memcached/protocol/TCPMemcachedNodeImpl.java","position":130,"original_position":130,"commit_id":"89d017ec40de6eccb7862696f55fee9c3cfe29fe","original_commit_id":"89d017ec40de6eccb7862696f55fee9c3cfe29fe","user":{"login":"jhpark816","id":175927,"avatar_url":"https://avatars.githubusercontent.com/u/175927?v=3","gravatar_id":"","url":"https://api.github.com/users/jhpark816","html_url":"https://github.com/jhpark816","followers_url":"https://api.github.com/users/jhpark816/followers","following_url":"https://api.github.com/users/jhpark816/following{/other_user}","gists_url":"https://api.github.com/users/jhpark816/gists{/gist_id}","starred_url":"https://api.github.com/users/jhpark816/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhpark816/subscriptions","organizations_url":"https://api.github.com/users/jhpark816/orgs","repos_url":"https://api.github.com/users/jhpark816/repos","events_url":"https://api.github.com/users/jhpark816/events{/privacy}","received_events_url":"https://api.github.com/users/jhpark816/received_events","type":"User","site_admin":false},"body":"이 위치에서 아래 변수를 사용하는 것이 좋을 것 같습니다.\r\nallAllToInput()에서 allOp가 변경되지 않는다는 것이 보장되는 건가요 ? 이 부분이 의심되어서..\r\n\r\n```\r\nint opCount = allOp.size();\r\n```","created_at":"2016-01-29T07:12:39Z","updated_at":"2016-01-29T07:12:39Z","html_url":"https://github.com/naver/arcus-java-client/pull/44#discussion_r51231732","pull_request_url":"https://api.github.com/repos/naver/arcus-java-client/pulls/44","_links":{"self":{"href":"https://api.github.com/repos/naver/arcus-java-client/pulls/comments/51231732"},"html":{"href":"https://github.com/naver/arcus-java-client/pull/44#discussion_r51231732"},"pull_request":{"href":"https://api.github.com/repos/naver/arcus-java-client/pulls/44"}}},"pull_request":{"url":"https://api.github.com/repos/naver/arcus-java-client/pulls/44","id":57471142,"html_url":"https://github.com/naver/arcus-java-client/pull/44","diff_url":"https://github.com/naver/arcus-java-client/pull/44.diff","patch_url":"https://github.com/naver/arcus-java-client/pull/44.patch","issue_url":"https://api.github.com/repos/naver/arcus-java-client/issues/44","number":44,"state":"open","locked":false,"title":"support switchover / failover","user":{"login":"whchoi83","id":4157797,"avatar_url":"https://avatars.githubusercontent.com/u/4157797?v=3","gravatar_id":"","url":"https://api.github.com/users/whchoi83","html_url":"https://github.com/whchoi83","followers_url":"https://api.github.com/users/whchoi83/followers","following_url":"https://api.github.com/users/whchoi83/following{/other_user}","gists_url":"https://api.github.com/users/whchoi83/gists{/gist_id}","starred_url":"https://api.github.com/users/whchoi83/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/whchoi83/subscriptions","organizations_url":"https://api.github.com/users/whchoi83/orgs","repos_url":"https://api.github.com/users/whchoi83/repos","events_url":"https://api.github.com/users/whchoi83/events{/privacy}","received_events_url":"https://api.github.com/users/whchoi83/received_events","type":"User","site_admin":false},"body":"swtichover 와 failover 기능이 추가된 내용입니다.\r\n@aiceru, @jhpark816 리뷰 부탁드립니다.","created_at":"2016-01-28T08:43:42Z","updated_at":"2016-01-29T07:12:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1c59d69dd82137b5f4c19c83a99f0a27fa11a773","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/naver/arcus-java-client/pulls/44/commits","review_comments_url":"https://api.github.com/repos/naver/arcus-java-client/pulls/44/comments","review_comment_url":"https://api.github.com/repos/naver/arcus-java-client/pulls/comments{/number}","comments_url":"https://api.github.com/repos/naver/arcus-java-client/issues/44/comments","statuses_url":"https://api.github.com/repos/naver/arcus-java-client/statuses/89d017ec40de6eccb7862696f55fee9c3cfe29fe","head":{"label":"naver:whchoi83/switchover","ref":"whchoi83/switchover","sha":"89d017ec40de6eccb7862696f55fee9c3cfe29fe","user":{"login":"naver","id":6589568,"avatar_url":"https://avatars.githubusercontent.com/u/6589568?v=3","gravatar_id":"","url":"https://api.github.com/users/naver","html_url":"https://github.com/naver","followers_url":"https://api.github.com/users/naver/followers","following_url":"https://api.github.com/users/naver/following{/other_user}","gists_url":"https://api.github.com/users/naver/gists{/gist_id}","starred_url":"https://api.github.com/users/naver/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/naver/subscriptions","organizations_url":"https://api.github.com/users/naver/orgs","repos_url":"https://api.github.com/users/naver/repos","events_url":"https://api.github.com/users/naver/events{/privacy}","received_events_url":"https://api.github.com/users/naver/received_events","type":"Organization","site_admin":false},"repo":{"id":19271811,"name":"arcus-java-client","full_name":"naver/arcus-java-client","owner":{"login":"naver","id":6589568,"avatar_url":"https://avatars.githubusercontent.com/u/6589568?v=3","gravatar_id":"","url":"https://api.github.com/users/naver","html_url":"https://github.com/naver","followers_url":"https://api.github.com/users/naver/followers","following_url":"https://api.github.com/users/naver/following{/other_user}","gists_url":"https://api.github.com/users/naver/gists{/gist_id}","starred_url":"https://api.github.com/users/naver/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/naver/subscriptions","organizations_url":"https://api.github.com/users/naver/orgs","repos_url":"https://api.github.com/users/naver/repos","events_url":"https://api.github.com/users/naver/events{/privacy}","received_events_url":"https://api.github.com/users/naver/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/naver/arcus-java-client","description":"Arcus Java client","fork":false,"url":"https://api.github.com/repos/naver/arcus-java-client","forks_url":"https://api.github.com/repos/naver/arcus-java-client/forks","keys_url":"https://api.github.com/repos/naver/arcus-java-client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/naver/arcus-java-client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/naver/arcus-java-client/teams","hooks_url":"https://api.github.com/repos/naver/arcus-java-client/hooks","issue_events_url":"https://api.github.com/repos/naver/arcus-java-client/issues/events{/number}","events_url":"https://api.github.com/repos/naver/arcus-java-client/events","assignees_url":"https://api.github.com/repos/naver/arcus-java-client/assignees{/user}","branches_url":"https://api.github.com/repos/naver/arcus-java-client/branches{/branch}","tags_url":"https://api.github.com/repos/naver/arcus-java-client/tags","blobs_url":"https://api.github.com/repos/naver/arcus-java-client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/naver/arcus-java-client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/naver/arcus-java-client/git/refs{/sha}","trees_url":"https://api.github.com/repos/naver/arcus-java-client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/naver/arcus-java-client/statuses/{sha}","languages_url":"https://api.github.com/repos/naver/arcus-java-client/languages","stargazers_url":"https://api.github.com/repos/naver/arcus-java-client/stargazers","contributors_url":"https://api.github.com/repos/naver/arcus-java-client/contributors","subscribers_url":"https://api.github.com/repos/naver/arcus-java-client/subscribers","subscription_url":"https://api.github.com/repos/naver/arcus-java-client/subscription","commits_url":"https://api.github.com/repos/naver/arcus-java-client/commits{/sha}","git_commits_url":"https://api.github.com/repos/naver/arcus-java-client/git/commits{/sha}","comments_url":"https://api.github.com/repos/naver/arcus-java-client/comments{/number}","issue_comment_url":"https://api.github.com/repos/naver/arcus-java-client/issues/comments{/number}","contents_url":"https://api.github.com/repos/naver/arcus-java-client/contents/{+path}","compare_url":"https://api.github.com/repos/naver/arcus-java-client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/naver/arcus-java-client/merges","archive_url":"https://api.github.com/repos/naver/arcus-java-client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/naver/arcus-java-client/downloads","issues_url":"https://api.github.com/repos/naver/arcus-java-client/issues{/number}","pulls_url":"https://api.github.com/repos/naver/arcus-java-client/pulls{/number}","milestones_url":"https://api.github.com/repos/naver/arcus-java-client/milestones{/number}","notifications_url":"https://api.github.com/repos/naver/arcus-java-client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/naver/arcus-java-client/labels{/name}","releases_url":"https://api.github.com/repos/naver/arcus-java-client/releases{/id}","deployments_url":"https://api.github.com/repos/naver/arcus-java-client/deployments","created_at":"2014-04-29T09:55:01Z","updated_at":"2016-01-26T23:33:42Z","pushed_at":"2016-01-29T06:44:59Z","git_url":"git://github.com/naver/arcus-java-client.git","ssh_url":"git@github.com:naver/arcus-java-client.git","clone_url":"https://github.com/naver/arcus-java-client.git","svn_url":"https://github.com/naver/arcus-java-client","homepage":null,"size":956,"stargazers_count":8,"watchers_count":8,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":13,"mirror_url":null,"open_issues_count":9,"forks":13,"open_issues":9,"watchers":8,"default_branch":"master"}},"base":{"label":"naver:replication","ref":"replication","sha":"2319e76316aeecc054398b51302c1c183fea84a5","user":{"login":"naver","id":6589568,"avatar_url":"https://avatars.githubusercontent.com/u/6589568?v=3","gravatar_id":"","url":"https://api.github.com/users/naver","html_url":"https://github.com/naver","followers_url":"https://api.github.com/users/naver/followers","following_url":"https://api.github.com/users/naver/following{/other_user}","gists_url":"https://api.github.com/users/naver/gists{/gist_id}","starred_url":"https://api.github.com/users/naver/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/naver/subscriptions","organizations_url":"https://api.github.com/users/naver/orgs","repos_url":"https://api.github.com/users/naver/repos","events_url":"https://api.github.com/users/naver/events{/privacy}","received_events_url":"https://api.github.com/users/naver/received_events","type":"Organization","site_admin":false},"repo":{"id":19271811,"name":"arcus-java-client","full_name":"naver/arcus-java-client","owner":{"login":"naver","id":6589568,"avatar_url":"https://avatars.githubusercontent.com/u/6589568?v=3","gravatar_id":"","url":"https://api.github.com/users/naver","html_url":"https://github.com/naver","followers_url":"https://api.github.com/users/naver/followers","following_url":"https://api.github.com/users/naver/following{/other_user}","gists_url":"https://api.github.com/users/naver/gists{/gist_id}","starred_url":"https://api.github.com/users/naver/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/naver/subscriptions","organizations_url":"https://api.github.com/users/naver/orgs","repos_url":"https://api.github.com/users/naver/repos","events_url":"https://api.github.com/users/naver/events{/privacy}","received_events_url":"https://api.github.com/users/naver/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/naver/arcus-java-client","description":"Arcus Java client","fork":false,"url":"https://api.github.com/repos/naver/arcus-java-client","forks_url":"https://api.github.com/repos/naver/arcus-java-client/forks","keys_url":"https://api.github.com/repos/naver/arcus-java-client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/naver/arcus-java-client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/naver/arcus-java-client/teams","hooks_url":"https://api.github.com/repos/naver/arcus-java-client/hooks","issue_events_url":"https://api.github.com/repos/naver/arcus-java-client/issues/events{/number}","events_url":"https://api.github.com/repos/naver/arcus-java-client/events","assignees_url":"https://api.github.com/repos/naver/arcus-java-client/assignees{/user}","branches_url":"https://api.github.com/repos/naver/arcus-java-client/branches{/branch}","tags_url":"https://api.github.com/repos/naver/arcus-java-client/tags","blobs_url":"https://api.github.com/repos/naver/arcus-java-client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/naver/arcus-java-client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/naver/arcus-java-client/git/refs{/sha}","trees_url":"https://api.github.com/repos/naver/arcus-java-client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/naver/arcus-java-client/statuses/{sha}","languages_url":"https://api.github.com/repos/naver/arcus-java-client/languages","stargazers_url":"https://api.github.com/repos/naver/arcus-java-client/stargazers","contributors_url":"https://api.github.com/repos/naver/arcus-java-client/contributors","subscribers_url":"https://api.github.com/repos/naver/arcus-java-client/subscribers","subscription_url":"https://api.github.com/repos/naver/arcus-java-client/subscription","commits_url":"https://api.github.com/repos/naver/arcus-java-client/commits{/sha}","git_commits_url":"https://api.github.com/repos/naver/arcus-java-client/git/commits{/sha}","comments_url":"https://api.github.com/repos/naver/arcus-java-client/comments{/number}","issue_comment_url":"https://api.github.com/repos/naver/arcus-java-client/issues/comments{/number}","contents_url":"https://api.github.com/repos/naver/arcus-java-client/contents/{+path}","compare_url":"https://api.github.com/repos/naver/arcus-java-client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/naver/arcus-java-client/merges","archive_url":"https://api.github.com/repos/naver/arcus-java-client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/naver/arcus-java-client/downloads","issues_url":"https://api.github.com/repos/naver/arcus-java-client/issues{/number}","pulls_url":"https://api.github.com/repos/naver/arcus-java-client/pulls{/number}","milestones_url":"https://api.github.com/repos/naver/arcus-java-client/milestones{/number}","notifications_url":"https://api.github.com/repos/naver/arcus-java-client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/naver/arcus-java-client/labels{/name}","releases_url":"https://api.github.com/repos/naver/arcus-java-client/releases{/id}","deployments_url":"https://api.github.com/repos/naver/arcus-java-client/deployments","created_at":"2014-04-29T09:55:01Z","updated_at":"2016-01-26T23:33:42Z","pushed_at":"2016-01-29T06:44:59Z","git_url":"git://github.com/naver/arcus-java-client.git","ssh_url":"git@github.com:naver/arcus-java-client.git","clone_url":"https://github.com/naver/arcus-java-client.git","svn_url":"https://github.com/naver/arcus-java-client","homepage":null,"size":956,"stargazers_count":8,"watchers_count":8,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":13,"mirror_url":null,"open_issues_count":9,"forks":13,"open_issues":9,"watchers":8,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/naver/arcus-java-client/pulls/44"},"html":{"href":"https://github.com/naver/arcus-java-client/pull/44"},"issue":{"href":"https://api.github.com/repos/naver/arcus-java-client/issues/44"},"comments":{"href":"https://api.github.com/repos/naver/arcus-java-client/issues/44/comments"},"review_comments":{"href":"https://api.github.com/repos/naver/arcus-java-client/pulls/44/comments"},"review_comment":{"href":"https://api.github.com/repos/naver/arcus-java-client/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/naver/arcus-java-client/pulls/44/commits"},"statuses":{"href":"https://api.github.com/repos/naver/arcus-java-client/statuses/89d017ec40de6eccb7862696f55fee9c3cfe29fe"}}}}