-
Notifications
You must be signed in to change notification settings - Fork 55
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: Refactor includes #787
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.
์ผ๋ถ ๋ฆฌ๋ทฐ
lqdetect.c
Outdated
uint32_t offset, uint32_t count, const bool delete, const bool drop_if_empty) | ||
{ | ||
if (access_count >= lqdetect.stats.threshold) { | ||
struct lq_detect_argument argument; | ||
int nwrite = do_make_bkeystring(argument.query, bkrange, efilter); | ||
int nwrite = do_make_bkeystring(argument.query, (bkey_range*)bkrange, (eflag_filter*)efilter); |
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.
bkey_range, eflag_filter, ENGINE_BTREE_ORDER ๋ฑ์ ๊ทธ๋๋ก ์ ์งํฉ์๋ค.
memcached header files์ includeํ๋ ์ฝ๋๋ฅผ ๋ชจ๋ ์ ๊ฑฐํ๋ ๊ฒ์ ์ด ๊ฒฝ์ฐ์๋ ๋ง์ง ์๋ ๊ฒ ๊ฐ์ต๋๋ค.
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.
๋ฐ์ํ์์ต๋๋ค.
b79063f
to
9e33576
Compare
@namsic ๋ฆฌ๋ทฐ ๋ฐ๋๋๋ค. |
lqdetect.c
Outdated
{ | ||
mc_logger = logger; | ||
mc_logger = (EXTENSION_LOGGER_DESCRIPTOR*)logger; |
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.
์๋ ํญ๋ชฉ์ ๋ํด ์๊ฒฌ ์ฃผ์๋ฉด ์ข๊ฒ ์ต๋๋ค.
mc_logger
์ฌ์ฉํ๋ ๊ณณ์ด ์๋๋ฐ, ์ ์งํ๋ ๊ฒ์ด ์ข์๊ฐ์?
- ์ธ์๋ก logger ์ ๋ฌ๋ฐ์์ผ ํ๋ค๋ฉด, ํค๋์์
logger.h
๋ฅผ includeํ๋ ๊ฒ์ ์๋ ๊ด์ ์์ ๋์์ง ์์ ๋ณด์ ๋๋ค.
-
๋ง์ฝ ์ธ์๋ก ๊ณ ์ ๋์ง ์์ ํ์ ์ ๋ฐ๊ณ ์ ์๋ํ ๊ฒ์ด๋ผ๋ฉด
void*
ํ์ ์ ์ฌ์ฉํ๋ ๊ฒ์ด ์ ์ฉํฉ๋๋ค. -
ํ์ง๋ง
lqdetect_init()
์ ๊ทธ๋ฐ ์ฑ๊ฒฉ์ ํจ์๊ฐ ์๋๊ณ , ํญ์EXTENTION_LOGGER_DESCRIPTOR
๋ฅผ ์ธ์๋ก ๋ฐ์์ผ ํฉ๋๋ค.
๋ฐ๋ผ์ ์ฌ์ฉ์๋lqdetect.h
๋ฅผ includeํ ๋ ํญ์extention_logger.h
๋ ํจ๊ป includeํด์ผ๋ง ํ ๊ฒ์ ๋๋ค. -
์ด๋ฐ ์ํฉ์์๋
lqdetect.h
์์logger.h
๋ฅผ includeํ๋ ๊ฒ์ด ๋ ์ ์ฉํ๋ค๊ณ ์๊ฐํฉ๋๋ค.lqdetect.h
์์logger.h
์ ์์กดํ๊ณ ์๋ ๊ด๊ณ๋ฅผ ๋ช ํํ ๋๋ฌ๋lqdetect_init()
์ ์ธ์๋กEXTENSION_LOGGER_DESCRIPTOR
๋ฅผ ๋๊ธด๋ค๋ ๊ฒ์ ํธ์ถํ๋ ์ธก์์ ์ ์ ์์
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.
๋์ค์ ์ฌ์ฉํ ๋ชฉ์ ์ผ๋ก mc_logger ์ ์งํ๋๋ก ํฉ์๋ค.
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.
์์ ์ค๋ช ๋ ๋๋ก, ๊ธฐ์กด ์ธํฐํ์ด์ค๋ฅผ ๊ทธ๋๋ก ์ ์งํ๋ ๊ฒ์ด ๋์ ๊ฒ ๊ฐ์ต๋๋ค.
int lqdetect_init(EXTENSION_LOGGER_DESCRIPTOR *logger)
์ฐธ๊ณ ์ฌํญ์ผ๋ก,
EXTENSION_LOGGER_DESCRIPTOR๋ include/memcached/extension.h
ํ์ผ์ ์์ต๋๋ค.
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.
mc_logger ๋ฅผ ์ ์งํ๊ณ lqdetect.h
์์ memcached/extension.h
๋ฅผ include ํ์ฌ lqdetect_init()
์ ์ ์ธ์ ๊ธฐ์กด๊ณผ ๋์ผํ๊ฒ ์ ์งํ๋๋ก ์์ ํ๊ฒ ์ต๋๋ค.
9e33576
to
68c38ef
Compare
๐ Related Issue
โจ๏ธ What I did
lqdetect.h
์ include ์์น๋ฅผmemcached.h
์์memcached.c
๋ก ๋ณ๊ฒฝํ์์ต๋๋ค.