-
Notifications
You must be signed in to change notification settings - Fork 49
FEAT: Add gat(get and touch) command to get item & update item expiraโฆ #941
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
base: develop
Are you sure you want to change the base?
Conversation
|
์์คํค ๋ช
๋ น์ด๋ |
๋ค ์๊ฒ ์ต๋๋ค. CASValue ํ์
์ ๋ฐํํ์ง ์๋๋ก ์์ ํ ํ, ์์คํค ๋ช
๋ น์ด๋ |
|
์ปค๋ฐ ๊ฐ์๊ฐ ๊ฐ์๊ธฐ ๋ง์์ก๋๋ฐ, ์ด๋ป๊ฒ ๋ ์ผ์ธ๊ฐ์? |
|
์์ผ๋ก PR์์ ์ฃผ์ํ๋ฉฐ ์ํํ๊ฒ ์ต๋๋ค. |
|
์๊ฒฌ์ด ๊ถ๊ธํด์ ์ง๋ฌธํฉ๋๋ค. gat์ ์๋ต์ get ๋ช
๋ น์ด์ ์๋ต๊ณผ ๋์ผํ ํฌ๋งท์
๋๋ค. |
|
๋ด๋ถ Operation ์์ฑ ๊ด์ ์์๋ ์ค๋ณต์ ์ต์ํํ๋ ๋ฐฉํฅ์ผ๋ก ๊ฐ๋ ๊ฒ์ ๋์ํฉ๋๋ค. ๊ทธ๋ฌ๋ฉด |
|
BaseGetOpImpl ํด๋์ค๋ฅผ ์์ํ๊ฒ ํ๊ณ , BaseGetOpImpl ํด๋์ค์ gat ๋ช ๋ น์ด๋ฅผ ์ํ expTime ํ๋๋ฅผ ์ถ๊ฐํ ๋ค์, BaseGetOpImpl ํด๋์ค์ ์ผ๋ถ ๋ฉ์๋๋ฅผ ์กฐ๊ธ ์์ ํ๋ฉด ๋ ๊ฒ ๊ฐ์ต๋๋ค. |
|
์ฒ์ ๊ตฌํํ ๋, ์ฝ๋ฉํธ์ฃผ์ ์ฌํญ์ ์๋ ์ ๋ฆฌํ์ต๋๋ค. ์ด ๋ด์ฉ์ ๋ฐํ์ผ๋ก ์ฝ๋๋ฅผ ์์ ํ๊ฒ ์ต๋๋ค.
|
|
@jhpark816 |
์์ ๊ฐ์ด ์งํํ๋ฉด ๋ฉ๋๋ค. |
2ac1311 to
0e0257a
Compare
|
@uhm0311 @oliviarla |
oliviarla
left a comment
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.
๋ฆฌ๋ทฐ ์๋ฃ์ ๋๋ค.
0e0257a to
a73d95a
Compare
jhpark816
left a comment
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.
๋ฆฌ๋ทฐ ์๋ฃ
| INCR(OperationType.WRITE), DECR(OperationType.WRITE), | ||
| DELETE(OperationType.WRITE), | ||
| GET(OperationType.READ), GETS(OperationType.READ), | ||
| GAT(OperationType.WRITE), |
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.
GET, GETS์ ๋์๋๊ฒ GAT ์ธ์๋ GATS๋ฅผ ๋ก์๋ค.
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.
OperationType.java ํ์ผ์์
Operation Hierarchy ๋ถ๋ถ์๋ ๋ฐ์ ๋ฐ๋๋๋ค.
src/main/java/net/spy/memcached/protocol/ascii/GetsAndTouchOperationImpl.java
Outdated
Show resolved
Hide resolved
cca3587
a73d95a to
cca3587
Compare
|
์ฝ๋ฉํธ ๋ด์ฉ ๋ชจ๋ ๋ฐ์ํ์ต๋๋ค. |
jhpark816
left a comment
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.
๋ฆฌ๋ทฐ ์๋ฃ
| * BTreeInsertAndGetOperationImpl (asyncBopInsertAndGetTrimmed) | ||
| * FlushOperationImpl / FlushByPrefixOperationImpl (flush) | ||
| * SetAttrOperationImpl (asyncSetAttr) | ||
| * GetAndTouchOperation / GetsAndTouchOperation (asyncGetAndTouch / asyncGetsAndTouch) |
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.
์๋์ ๊ฐ์ด ์ ๋ฆฌ๋์ด์ผ ํ ๊ฒ ๊ฐ์ต๋๋ค.
GetAndTouchOperationImpl / GetsAndTouchOperationImpl (asyncGetAndTouch / asyncGetsAndTouch)
| super(cb); | ||
| cmd = c; | ||
| keys = k; | ||
| exp = 0; |
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.
gat, gats์์ exp ๊ฐ์ 0์ ์ค ์ ์์ต๋๋ค.
๋ฐ๋ผ์, exp ๊ฐ ์์ฒด๋ง์ผ๋ก๋ ์ ์์ ์ธ ๊ฐ์ธ์ง ํ์ธํ ์ ์๊ณ ,
cmd ๊ฐ์ ํ์ธํ๊ณ exp ์ฌ์ฉ ์ฌ๋ถ๋ฅผ ๊ฒฐ์ ํด์ผ ํฉ๋๋ค.
๊ทธ๋ฌ๋ฉด, ์ฌ๊ธฐ์ exp ๊ฐ์ ์ค์ ํด ๋ ํ์๊ฐ ์๋ ์ง ๋ชจ๋ฅด๊ฒ ์ด์.
|
#941 (comment) ์ฝ๋ฉํธ๋ฅผ ํ์ธํ์ธ์. |
cca3587 to
c6d47e5
Compare
|
@jhpark816 |
|
@ing-eoking
|
๋ค, ์บ์ ์๋ฒ์์๋ get and touch ์ฐ์ฐ ์ค ์คํจ๊ฐ ๋ฐ์ํ๋๋ผ๋ ๋ณ๋์ ์๋ฌ ์๋ต์ ๋ณด๋ด์ง ์์ต๋๋ค. gat ๋ช
๋ น์ด๋ ๋ด๋ถ์ ์ผ๋ก get -> touch(setattr) ์์๋ก ๋์ํ๋ฉฐ,
์ด ์ค replication์ด๋ migration ๊ด๋ จ ์ด์๋ก ์ธํ ์คํจ๋ ๋ ๋ฒ์งธ ๊ฒฝ์ฐ์ ํด๋นํ๋ฉฐ, ์ด๋ gat ์ฐ์ฐ์ด ๊ธฐ์กด get ์ฐ์ฐ์ ๋ก์ง์ ๊ทธ๋๋ก ํ์ฉํ๋ฉด์ ์ ์ฌํ ๋ฐฉ์์ผ๋ก ๋์ํ๋๋ก ๊ตฌํ๋์๊ธฐ ๋๋ฌธ์
๋๋ค. ์ฆ, ๊ธฐ์กด get ์ฐ์ฐ ์ญ์ ํด๋น ์์ดํ
์ด ์บ์ ๋ฏธ์ค๋ก ์คํจํ๋์ง, ํ์
๋ถ์ผ์น๋ก ์คํจํ๋์ง์ ๋ํ ๊ตฌ๋ถ ์์ด ์ฒ๋ฆฌ๋ฉ๋๋ค. |
๐ Related Issue
โจ๏ธ What I did
memcached ์๋ฒ์
gat๋ฅผ java-client์๋ ์ถ๊ฐํฉ๋๋ค.์ด๋ฅผ ํตํด expire time์ ์ฌ์ค์ ๊ฐ๋ฅํ๋๋ก ํฉ๋๋ค.
Operation์ธํฐํ์ด์ค ๋ฐ Ascii, Binary ํ๋กํ ์ฝ ๊ตฌํ์ฒด ์ถ๊ฐOperationFactory์GetAndTouch์ถ๊ฐMemcachedClient์ ์ฌ์ฉ์๊ฐ ํธ์ถํ ์ ์๋gat๊ธฐ๋ฅ ์ถ๊ฐgat๊ธฐ๋ฅ์ ์ํ ํ ์คํธ ์ฝ๋ ์ถ๊ฐCI Test ์คํจ ๊ด๋ จ
ํ์ฌ ์คํจํ๊ณ ์๋ CI Test๋
JDK 21, ubuntu-latest์์ Test ARCUS Client with ZK๋ฅผ ์คํจํ๊ณ ์์ต๋๋ค.์ฝ๋์์๋
AsciiClientTest์gat๊ด๋ จ ํ ์คํธ๋ฅผ ์คํจํ๊ณ ์์ต๋๋ค.ํด๋น ํ ์คํธ๋ ํ์ฌ ๋์ปค์ ๋ฆด๋ฆฌ์ฆ๋ memcached ์๋ฒ๋
gat๊ธฐ๋ฅ์ด ์์ง ๋ฐ์๋์ง ์์๊ธฐ์, ํ ์คํธ์ฝ๋์์gat๋ช ๋ น์ ์์ฒญํด๋ ์๋ต์ด ์๋ ๋ฌธ์ ์ ๋๋ค.