Skip to content
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

CLEANUP: tidy MemcachedClient codes #800

Merged
merged 1 commit into from
Aug 28, 2024
Merged

Conversation

oliviarla
Copy link
Collaborator

๐Ÿ”— Related Issue

โŒจ๏ธ What I did

  • ์šฉ์–ด ๋ณ€๊ฒฝ
    • unserialize -> deserialize
    • tc_iter -> tcIter
    • tc_map -> tcMap
  • ๋™๊ธฐ ๋ฐฉ์‹ ๋ฉ”์„œ๋“œ ์ œ๊ณต ์‹œ future.get ํ•˜์—ฌ ์˜ˆ์™ธ์ฒ˜๋ฆฌํ•˜๋Š” ์ฝ”๋“œ์˜ ์ค‘๋ณต์„ getFromFuture ๋ฉ”์„œ๋“œ๋กœ ๋ถ„๋ฆฌ
  • addKeyToMap ๋ฉ”์„œ๋“œ์—์„œ Map.computeIfAbsent ์‚ฌ์šฉํ•˜๋„๋ก ๋ณ€๊ฒฝ
  • run ๋ฉ”์„œ๋“œ์—์„œ ์˜ˆ์™ธ ์ฒ˜๋ฆฌ ๋‹จ์ˆœํ™” (CancelledKeyException, ClosedSelectorException์€ IllegalStateException์˜ ํ•˜์œ„ ํƒ€์ž…์ด๋ฏ€๋กœ ๋ณ„๋„๋กœ ์ฒดํฌํ•˜์ง€ ์•Š์•„๋„๋จ)

keyMap.put(node, keyList);
}
keyList.add(key);
keyMap.computeIfAbsent(node, k -> new ArrayList<>()).add(key);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์งˆ๋ฌธ ํ•˜๋‚˜๋งŒ ํ•ฉ๋‹ˆ๋‹ค.
computed value๊ฐ€ NULL ์ผ ์ˆ˜๋Š” ์—†๋Š”๊ฑฐ์ฃ ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

keyMap์—์„œ node์— ๋Œ€ํ•œ entry๊ฐ€ ์—†๊ฑฐ๋‚˜ value๊ฐ€ null์ธ ๊ฒฝ์šฐ new ArrayList<>()๋ฅผ value๋กœ ๋Œ€์ž…ํ•ด์ค๋‹ˆ๋‹ค.
๋”ฐ๋ผ์„œ add(key) ๋ฉ”์„œ๋“œ๋ฅผ ์ˆ˜ํ–‰ํ•  ๋•Œ nullpointerexception์€ ๋ฐœ์ƒํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@oliviarla
ํ˜„ ์ƒํƒœ๋กœ merge ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค.

addKeyToMap() ๋ฉ”์†Œ๋“œ๋ฅผ ํ˜ธ์ถœํ•˜์ง€ ์•Š๊ณ ,
ํ˜ธ์ถœ ์ชฝ์—์„œ ํ•ด๋‹น ๋กœ์ง์„ ์ง์ ‘ ๊ฐ€์ง€๋Š” ๊ฒƒ์ด ์ข‹์„ ๊ฒƒ ๊ฐ™์€ ๋ฐ,
ํ™•์ธํ•˜๊ณ  ๋™์˜ํ•œ๋‹ค๋ฉด PR ๋ณด๋‚ด ์ฃผ์„ธ์š”.

@jhpark816 jhpark816 merged commit fb565bd into naver:develop Aug 28, 2024
3 checks passed
@oliviarla oliviarla deleted the tidy branch September 4, 2024 07:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants