{"action":"created","comment":{"url":"https://api.github.com/repos/naver/arcus-memcached/pulls/comments/74179292","id":74179292,"diff_hunk":"@@ -8473,18 +8473,69 @@ static void do_map_node_unlink(struct default_engine *engine,\n     do_map_node_free(engine, node);\n }\n \n+static ENGINE_ERROR_CODE do_map_elem_replace(struct default_engine *engine, map_meta_info *info,\n+                                             map_prev_info *pinfo, map_elem_item *new_elem)\n+{\n+    map_elem_item *prev = pinfo->prev;\n+    map_elem_item *old_elem;\n+\n+    if (prev != NULL) {\n+        old_elem = pinfo->prev->next;\n+    } else {\n+        old_elem = (map_elem_item *)pinfo->node->htab[pinfo->hidx];\n+    }\n+\n+    size_t old_stotal = slabs_space_size(engine, do_map_elem_ntotal(old_elem));\n+    size_t new_stotal = slabs_space_size(engine, do_map_elem_ntotal(new_elem));\n+\n+#ifdef ENABLE_STICKY_ITEM\n+    if (new_stotal > old_stotal) {\n+        /* sticky memory limit check */\n+        if ((info->mflags & COLL_META_FLAG_STICKY) != 0) {\n+            if (engine->stats.sticky_bytes >= engine->config.sticky_limit)\n+                return ENGINE_ENOMEM;\n+        }\n+    }\n+#endif\n+\n+    new_elem->next = old_elem->next;\n+    if (prev != NULL) {\n+        prev->next = new_elem;\n+    } else {\n+        pinfo->node->htab[pinfo->hidx] = new_elem;\n+    }\n+\n+    old_elem->next = (map_elem_item *)ADDR_MEANS_UNLINKED;\n+    if (old_elem->refcount == 0) {\n+        do_map_elem_free(engine, old_elem);\n+    }\n+\n+    if (new_stotal != old_stotal) {\n+        assert(info->stotal > 0);\n+        if (new_stotal > old_stotal) {\n+            increase_collection_space(engine, ITEM_TYPE_MAP, (coll_meta_info *)info, (new_stotal-old_stotal));\n+        } else {\n+            decrease_collection_space(engine, ITEM_TYPE_MAP, (coll_meta_info *)info, (old_stotal-new_stotal));\n+        }\n+    }\n+    return ENGINE_SUCCESS;\n+}\n+\n static ENGINE_ERROR_CODE do_map_elem_link(struct default_engine *engine,\n                                           map_meta_info *info, map_elem_item *elem,\n-                                          const void *cookie)\n+                                          const bool replace_if_exist, const void *cookie)\n {\n     assert(info->root != NULL);\n     map_hash_node *node = info->root;\n+    map_elem_item *prev = NULL;\n     map_elem_item *find;\n+    map_prev_info pinfo;\n+    ENGINE_ERROR_CODE res = ENGINE_SUCCESS;\n+\n     int hidx = -1;\n \n     /* map hash value */\n     elem->hval = genhash_string_hash(elem->data, elem->nfield);\n-","path":"engines/default/items.c","position":68,"original_position":68,"commit_id":"5a63f5e3371afa3bb9911c520656cf4e1bc6f192","original_commit_id":"5a63f5e3371afa3bb9911c520656cf4e1bc6f192","user":{"login":"MinWooJin","id":9632854,"avatar_url":"https://avatars.githubusercontent.com/u/9632854?v=3","gravatar_id":"","url":"https://api.github.com/users/MinWooJin","html_url":"https://github.com/MinWooJin","followers_url":"https://api.github.com/users/MinWooJin/followers","following_url":"https://api.github.com/users/MinWooJin/following{/other_user}","gists_url":"https://api.github.com/users/MinWooJin/gists{/gist_id}","starred_url":"https://api.github.com/users/MinWooJin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MinWooJin/subscriptions","organizations_url":"https://api.github.com/users/MinWooJin/orgs","repos_url":"https://api.github.com/users/MinWooJin/repos","events_url":"https://api.github.com/users/MinWooJin/events{/privacy}","received_events_url":"https://api.github.com/users/MinWooJin/received_events","type":"User","site_admin":false},"body":"여기가 하나 수정이 되어있었네요, 수정하도록 하겠습니다.","created_at":"2016-08-10T03:02:11Z","updated_at":"2016-08-10T03:02:11Z","html_url":"https://github.com/naver/arcus-memcached/pull/63#discussion_r74179292","pull_request_url":"https://api.github.com/repos/naver/arcus-memcached/pulls/63","_links":{"self":{"href":"https://api.github.com/repos/naver/arcus-memcached/pulls/comments/74179292"},"html":{"href":"https://github.com/naver/arcus-memcached/pull/63#discussion_r74179292"},"pull_request":{"href":"https://api.github.com/repos/naver/arcus-memcached/pulls/63"}}},"pull_request":{"url":"https://api.github.com/repos/naver/arcus-memcached/pulls/63","id":80398879,"html_url":"https://github.com/naver/arcus-memcached/pull/63","diff_url":"https://github.com/naver/arcus-memcached/pull/63.diff","patch_url":"https://github.com/naver/arcus-memcached/pull/63.patch","issue_url":"https://api.github.com/repos/naver/arcus-memcached/issues/63","number":63,"state":"open","locked":false,"title":"MAP_COLLECTION: add replace_if_exist flag for replication in map elem…","user":{"login":"MinWooJin","id":9632854,"avatar_url":"https://avatars.githubusercontent.com/u/9632854?v=3","gravatar_id":"","url":"https://api.github.com/users/MinWooJin","html_url":"https://github.com/MinWooJin","followers_url":"https://api.github.com/users/MinWooJin/followers","following_url":"https://api.github.com/users/MinWooJin/following{/other_user}","gists_url":"https://api.github.com/users/MinWooJin/gists{/gist_id}","starred_url":"https://api.github.com/users/MinWooJin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MinWooJin/subscriptions","organizations_url":"https://api.github.com/users/MinWooJin/orgs","repos_url":"https://api.github.com/users/MinWooJin/repos","events_url":"https://api.github.com/users/MinWooJin/events{/privacy}","received_events_url":"https://api.github.com/users/MinWooJin/received_events","type":"User","site_admin":false},"body":"… insert\r\n\r\nFirst reviewer\r\n- [ ] @minkikim89 \r\n\r\nFinal reviewer\r\n- [ ] @jhpark816 ","created_at":"2016-08-08T06:11:53Z","updated_at":"2016-08-10T03:02:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"48fbfca87bdd92c5ff4d4f9252bdc6e09648de1e","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/naver/arcus-memcached/pulls/63/commits","review_comments_url":"https://api.github.com/repos/naver/arcus-memcached/pulls/63/comments","review_comment_url":"https://api.github.com/repos/naver/arcus-memcached/pulls/comments{/number}","comments_url":"https://api.github.com/repos/naver/arcus-memcached/issues/63/comments","statuses_url":"https://api.github.com/repos/naver/arcus-memcached/statuses/5a63f5e3371afa3bb9911c520656cf4e1bc6f192","head":{"label":"MinWooJin:refactor_addmap","ref":"refactor_addmap","sha":"5a63f5e3371afa3bb9911c520656cf4e1bc6f192","user":{"login":"MinWooJin","id":9632854,"avatar_url":"https://avatars.githubusercontent.com/u/9632854?v=3","gravatar_id":"","url":"https://api.github.com/users/MinWooJin","html_url":"https://github.com/MinWooJin","followers_url":"https://api.github.com/users/MinWooJin/followers","following_url":"https://api.github.com/users/MinWooJin/following{/other_user}","gists_url":"https://api.github.com/users/MinWooJin/gists{/gist_id}","starred_url":"https://api.github.com/users/MinWooJin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MinWooJin/subscriptions","organizations_url":"https://api.github.com/users/MinWooJin/orgs","repos_url":"https://api.github.com/users/MinWooJin/repos","events_url":"https://api.github.com/users/MinWooJin/events{/privacy}","received_events_url":"https://api.github.com/users/MinWooJin/received_events","type":"User","site_admin":false},"repo":{"id":39232495,"name":"arcus-memcached","full_name":"MinWooJin/arcus-memcached","owner":{"login":"MinWooJin","id":9632854,"avatar_url":"https://avatars.githubusercontent.com/u/9632854?v=3","gravatar_id":"","url":"https://api.github.com/users/MinWooJin","html_url":"https://github.com/MinWooJin","followers_url":"https://api.github.com/users/MinWooJin/followers","following_url":"https://api.github.com/users/MinWooJin/following{/other_user}","gists_url":"https://api.github.com/users/MinWooJin/gists{/gist_id}","starred_url":"https://api.github.com/users/MinWooJin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MinWooJin/subscriptions","organizations_url":"https://api.github.com/users/MinWooJin/orgs","repos_url":"https://api.github.com/users/MinWooJin/repos","events_url":"https://api.github.com/users/MinWooJin/events{/privacy}","received_events_url":"https://api.github.com/users/MinWooJin/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/MinWooJin/arcus-memcached","description":"Arcus memory cache server","fork":true,"url":"https://api.github.com/repos/MinWooJin/arcus-memcached","forks_url":"https://api.github.com/repos/MinWooJin/arcus-memcached/forks","keys_url":"https://api.github.com/repos/MinWooJin/arcus-memcached/keys{/key_id}","collaborators_url":"https://api.github.com/repos/MinWooJin/arcus-memcached/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/MinWooJin/arcus-memcached/teams","hooks_url":"https://api.github.com/repos/MinWooJin/arcus-memcached/hooks","issue_events_url":"https://api.github.com/repos/MinWooJin/arcus-memcached/issues/events{/number}","events_url":"https://api.github.com/repos/MinWooJin/arcus-memcached/events","assignees_url":"https://api.github.com/repos/MinWooJin/arcus-memcached/assignees{/user}","branches_url":"https://api.github.com/repos/MinWooJin/arcus-memcached/branches{/branch}","tags_url":"https://api.github.com/repos/MinWooJin/arcus-memcached/tags","blobs_url":"https://api.github.com/repos/MinWooJin/arcus-memcached/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/MinWooJin/arcus-memcached/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/MinWooJin/arcus-memcached/git/refs{/sha}","trees_url":"https://api.github.com/repos/MinWooJin/arcus-memcached/git/trees{/sha}","statuses_url":"https://api.github.com/repos/MinWooJin/arcus-memcached/statuses/{sha}","languages_url":"https://api.github.com/repos/MinWooJin/arcus-memcached/languages","stargazers_url":"https://api.github.com/repos/MinWooJin/arcus-memcached/stargazers","contributors_url":"https://api.github.com/repos/MinWooJin/arcus-memcached/contributors","subscribers_url":"https://api.github.com/repos/MinWooJin/arcus-memcached/subscribers","subscription_url":"https://api.github.com/repos/MinWooJin/arcus-memcached/subscription","commits_url":"https://api.github.com/repos/MinWooJin/arcus-memcached/commits{/sha}","git_commits_url":"https://api.github.com/repos/MinWooJin/arcus-memcached/git/commits{/sha}","comments_url":"https://api.github.com/repos/MinWooJin/arcus-memcached/comments{/number}","issue_comment_url":"https://api.github.com/repos/MinWooJin/arcus-memcached/issues/comments{/number}","contents_url":"https://api.github.com/repos/MinWooJin/arcus-memcached/contents/{+path}","compare_url":"https://api.github.com/repos/MinWooJin/arcus-memcached/compare/{base}...{head}","merges_url":"https://api.github.com/repos/MinWooJin/arcus-memcached/merges","archive_url":"https://api.github.com/repos/MinWooJin/arcus-memcached/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/MinWooJin/arcus-memcached/downloads","issues_url":"https://api.github.com/repos/MinWooJin/arcus-memcached/issues{/number}","pulls_url":"https://api.github.com/repos/MinWooJin/arcus-memcached/pulls{/number}","milestones_url":"https://api.github.com/repos/MinWooJin/arcus-memcached/milestones{/number}","notifications_url":"https://api.github.com/repos/MinWooJin/arcus-memcached/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/MinWooJin/arcus-memcached/labels{/name}","releases_url":"https://api.github.com/repos/MinWooJin/arcus-memcached/releases{/id}","deployments_url":"https://api.github.com/repos/MinWooJin/arcus-memcached/deployments","created_at":"2015-07-17T03:12:42Z","updated_at":"2016-04-08T07:43:26Z","pushed_at":"2016-08-09T02:38:56Z","git_url":"git://github.com/MinWooJin/arcus-memcached.git","ssh_url":"git@github.com:MinWooJin/arcus-memcached.git","clone_url":"https://github.com/MinWooJin/arcus-memcached.git","svn_url":"https://github.com/MinWooJin/arcus-memcached","homepage":null,"size":2243,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"naver:develop","ref":"develop","sha":"49b618176466ab38edc8ebb20dabbde8af3b1e10","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":19269792,"name":"arcus-memcached","full_name":"naver/arcus-memcached","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-memcached","description":"Arcus memory cache server","fork":false,"url":"https://api.github.com/repos/naver/arcus-memcached","forks_url":"https://api.github.com/repos/naver/arcus-memcached/forks","keys_url":"https://api.github.com/repos/naver/arcus-memcached/keys{/key_id}","collaborators_url":"https://api.github.com/repos/naver/arcus-memcached/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/naver/arcus-memcached/teams","hooks_url":"https://api.github.com/repos/naver/arcus-memcached/hooks","issue_events_url":"https://api.github.com/repos/naver/arcus-memcached/issues/events{/number}","events_url":"https://api.github.com/repos/naver/arcus-memcached/events","assignees_url":"https://api.github.com/repos/naver/arcus-memcached/assignees{/user}","branches_url":"https://api.github.com/repos/naver/arcus-memcached/branches{/branch}","tags_url":"https://api.github.com/repos/naver/arcus-memcached/tags","blobs_url":"https://api.github.com/repos/naver/arcus-memcached/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/naver/arcus-memcached/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/naver/arcus-memcached/git/refs{/sha}","trees_url":"https://api.github.com/repos/naver/arcus-memcached/git/trees{/sha}","statuses_url":"https://api.github.com/repos/naver/arcus-memcached/statuses/{sha}","languages_url":"https://api.github.com/repos/naver/arcus-memcached/languages","stargazers_url":"https://api.github.com/repos/naver/arcus-memcached/stargazers","contributors_url":"https://api.github.com/repos/naver/arcus-memcached/contributors","subscribers_url":"https://api.github.com/repos/naver/arcus-memcached/subscribers","subscription_url":"https://api.github.com/repos/naver/arcus-memcached/subscription","commits_url":"https://api.github.com/repos/naver/arcus-memcached/commits{/sha}","git_commits_url":"https://api.github.com/repos/naver/arcus-memcached/git/commits{/sha}","comments_url":"https://api.github.com/repos/naver/arcus-memcached/comments{/number}","issue_comment_url":"https://api.github.com/repos/naver/arcus-memcached/issues/comments{/number}","contents_url":"https://api.github.com/repos/naver/arcus-memcached/contents/{+path}","compare_url":"https://api.github.com/repos/naver/arcus-memcached/compare/{base}...{head}","merges_url":"https://api.github.com/repos/naver/arcus-memcached/merges","archive_url":"https://api.github.com/repos/naver/arcus-memcached/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/naver/arcus-memcached/downloads","issues_url":"https://api.github.com/repos/naver/arcus-memcached/issues{/number}","pulls_url":"https://api.github.com/repos/naver/arcus-memcached/pulls{/number}","milestones_url":"https://api.github.com/repos/naver/arcus-memcached/milestones{/number}","notifications_url":"https://api.github.com/repos/naver/arcus-memcached/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/naver/arcus-memcached/labels{/name}","releases_url":"https://api.github.com/repos/naver/arcus-memcached/releases{/id}","deployments_url":"https://api.github.com/repos/naver/arcus-memcached/deployments","created_at":"2014-04-29T08:47:43Z","updated_at":"2016-08-01T03:54:29Z","pushed_at":"2016-08-10T01:51:54Z","git_url":"git://github.com/naver/arcus-memcached.git","ssh_url":"git@github.com:naver/arcus-memcached.git","clone_url":"https://github.com/naver/arcus-memcached.git","svn_url":"https://github.com/naver/arcus-memcached","homepage":null,"size":32662,"stargazers_count":20,"watchers_count":20,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":21,"mirror_url":null,"open_issues_count":3,"forks":21,"open_issues":3,"watchers":20,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/naver/arcus-memcached/pulls/63"},"html":{"href":"https://github.com/naver/arcus-memcached/pull/63"},"issue":{"href":"https://api.github.com/repos/naver/arcus-memcached/issues/63"},"comments":{"href":"https://api.github.com/repos/naver/arcus-memcached/issues/63/comments"},"review_comments":{"href":"https://api.github.com/repos/naver/arcus-memcached/pulls/63/comments"},"review_comment":{"href":"https://api.github.com/repos/naver/arcus-memcached/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/naver/arcus-memcached/pulls/63/commits"},"statuses":{"href":"https://api.github.com/repos/naver/arcus-memcached/statuses/5a63f5e3371afa3bb9911c520656cf4e1bc6f192"}}}}
{"actor":{"display_login":"MinWooJin"}}