-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโll occasionally send you account related emails.
Already on GitHub? Sign in to your account
INTERNAL: use groupingKeys in asyncGet(s)Bulk #801
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๋ฆฌ๋ทฐ ์๋ฃ
Collection<String> keyList, int maxKeyCountPerGroup) { | ||
List<Map.Entry<MemcachedNode, List<String>>> resultList = new ArrayList<>(); | ||
Map<MemcachedNode, List<String>> nodeMap = new HashMap<>(); | ||
MemcachedConnection conn = getMemcachedConnection(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MemcachedClient ํด๋์ค๋ก ์ฎ๊ฒผ์ผ๋ฏ๋ก, ์๋ ์ฝ๋๋ ์์ด๋ ๋ฉ๋๋ค.
MemcachedConnection conn = getMemcachedConnection();
op = opFact.mgets(keyList, cb); | ||
} else { | ||
op = node.enabledMGetsOp() ? opFact.mgets(keyList, cb) | ||
: opFact.gets(keyList, cb); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์๋์ ๊ฐ์ ์ฝ๋์ด๋ฉด ์ข๊ฒ ์ต๋๋ค.
op = node.enabledMGetsOp() ? opFact.mgets(keyList, cb)
: opFact.gets(keyList, cb);
conn.addOperation(node, op); | ||
ops.add(op); | ||
Operation op; | ||
if (node == null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์ฌ๊ธฐ๋ ์ง๋ฌธ์ ๋๋ค.
node == null
์ํฉ์์ operation ๊ฐ์ฒด๋ฅผ ๋ง๋ค์ด connection์ ์ถ๊ฐํ ํ์๊ฐ ์๋์?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ํ์ฌ๋ connection์์ node๊ฐ null์ผ ๊ฒฝ์ฐ op๋ฅผ cancel ์ํค๊ณ ์์ต๋๋ค.
์ฌ๋ฌ ๋
ธ๋์ ๋ค์ํ mget op๋ฅผ ๋ณด๋ด๋๊ณ node๊ฐ null์ผ ๊ฒฝ์ฐ๊ฐ ๋ฐ์ํ๋ฉด cancel๋ก ์ธํด ์์ธ๊ฐ ๋ฐ์ํ๊ธฐ ๋๋ฌธ์, get/mget ์์ฒญ์ด ์๋ฒ์์ ์ฒ๋ฆฌ๋์์ง๋ง ๊ฒฐ๊ณผ๊ฐ์ ์ป์ ์ ์๋ ์ํฉ์ด ๋ฐ์ํ ์ ์์ต๋๋ค.
์ด๋ฅผ ๋ง์ผ๋ ค๋ฉด node๊ฐ null์ธ ์ํฉ์ด ๋ฐ์ํ ๋ ๊ธฐ์กด ops list์ ์กด์ฌํ๋ ๋ชจ๋ op๋ฅผ cancel์ํค๊ณ ์ด op๋ cancel์ํค๊ณ ์์ธ๋ฅผ ๋์ง๋ฉด ๋ ๊ฒ ๊ฐ์ต๋๋ค.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
node๊ฐ null ์ด๋ผ๋ ์๋ฏธ๋ ํ์ฌ ๋จ์ ์๋ node๊ฐ ์๋ค๋ ๊ฒ์ด๋ฏ๋ก,
๋ชจ๋ key๋ค์ด null node์ mapping ๋ ๊ฒ ๊ฐ๊ณ , ์์ฑํ๋ ๋ชจ๋ op๊ฐ ์์ฑ๋ ๊ฒ ๊ฐ์ต๋๋ค.
๋ง์ง ์๋ ๋ถ๋ถ์ด ์์ผ๋ฉด, ์๋ ค์ฃผ์ธ์.
๐ Related Issue
โจ๏ธ What I did