-
Notifications
You must be signed in to change notification settings - Fork 50
FEATURE: Add CompletableFuture BTree update API #1063
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| package net.spy.memcached.v2.vo; | ||
|
|
||
| import net.spy.memcached.collection.ElementFlagUpdate; | ||
|
|
||
| public final class BTreeUpdateElement<V> { | ||
| private final BKey bkey; | ||
| private final V value; | ||
| private final ElementFlagUpdate eFlagUpdate; | ||
|
|
||
| private BTreeUpdateElement(BKey bkey, V value, ElementFlagUpdate eFlagUpdate) { | ||
| if (bkey == null) { | ||
| throw new IllegalArgumentException("BKey cannot be null."); | ||
| } | ||
|
|
||
| this.bkey = bkey; | ||
| this.value = value; | ||
| this.eFlagUpdate = eFlagUpdate; | ||
| } | ||
|
|
||
| public static <V> BTreeUpdateElement<V> withValue(BKey bkey, V value) { | ||
| if (value == null) { | ||
| throw new IllegalArgumentException("Value cannot be null."); | ||
| } | ||
| return new BTreeUpdateElement<>(bkey, value, null); | ||
| } | ||
|
|
||
| public static <V> BTreeUpdateElement<V> withEFlagUpdate(BKey bkey, | ||
| ElementFlagUpdate eFlagUpdate) { | ||
| if (eFlagUpdate == null) { | ||
| throw new IllegalArgumentException("EFlagUpdate cannot be null."); | ||
| } | ||
| return new BTreeUpdateElement<>(bkey, null, eFlagUpdate); | ||
| } | ||
|
|
||
| public static <V> BTreeUpdateElement<V> withValueAndEFlag(BKey bkey, | ||
| V value, | ||
| ElementFlagUpdate eFlagUpdate) { | ||
| if (value == null || eFlagUpdate == null) { | ||
| throw new IllegalArgumentException("Both value and eFlagUpdate cannot be null."); | ||
| } | ||
| return new BTreeUpdateElement<>(bkey, value, eFlagUpdate); | ||
| } | ||
|
|
||
| public BKey getBkey() { | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ์ง๋ฌธ์
๋๋ค.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. getBkey() ์ฉ์ด์ ๊ดํ ๋ฌธ์ ์ด๋,
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ํ์ฌ v2์ vo ํจํค์ง ๋ด์์๋
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ์ฉ์ด ํต์ผ์ ๋ณ๋ PR๋ก ์งํํด ์ฃผ์์ฃ . |
||
| return bkey; | ||
| } | ||
|
|
||
| public V getValue() { | ||
| return value; | ||
| } | ||
|
|
||
| public ElementFlagUpdate getEFlagUpdate() { | ||
| return eFlagUpdate; | ||
| } | ||
| } | ||
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.
collectionUpdate์ CachedData๋ฅผ ๋ฐ๋ก ๋๊ธฐ๋ ๊ฒ ๋ณด๋ค
CachedData ์์ฑํ์ฌ ๋ค์ collectionUpdate์ setํ๊ณ
collectionUpdate๋ง ๋๊ธฐ๋ ๊ฒ์ด ์ข์ง ์๋ ์๊ฐ๋ฉ๋๋ค.
ํฅํ ๋ฆฌํฉํ ๋ง ๋์์ด ๋๋ ์ง ๊ฒํ ๋ฐ๋๋๋ค.
๋ณธ PR์์๋ ์ผ๋จ ๋ฌธ์ ์์ต๋๋ค.
Uh oh!
There was an error while loading. Please reload this page.
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.
์๋์ ๊ฐ์ด ๋ณ๊ฒฝํ ์ ์์ ๊ฒ ๊ฐ์ต๋๋ค.
as-is
AsyncArcusCommands.java
AsciiOperationFactory.java
to-be
AsyncArcusCommands.java
AsciiOperationFactory.java
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.
๋ง์ํด์ฃผ์ ๋ฐฉ์๋๋ก ๋ณ๊ฒฝํ ๊ฒฝ์ฐ CollectionInsert ๋ํ ๋์ผํ๊ฒ ์์ ์ด ๊ฐ๋ฅํ ๊ฒ ๊ฐ์ต๋๋ค.
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.
๋ฏผ๊ฒฝ๋๊ณผ ์๊ฒฌ์ ๋ ผ์ํด๋ณธ ๊ฒฐ๊ณผ ์์์ ์ธ๊ธํ๋
collectionUpdate๋ฆฌํฉํ ๋ง์ ์งํํ๋ ๋ฐฉํฅ์ผ๋ก ์๊ฒฌ์ด ๋ชจ์์ก์ต๋๋ค.๋ค๋ง, ํ์ฌ v2 ์์ ๋ง๋ฌด๋ฆฌ๊ฐ ์ฐ์ ์์๊ฐ ๋ ๋๋ค๊ณ ๋ณด์ฌ์ง๊ณ ํด๋น ๋ฆฌํฉํ ๋ง ์์ ์ ์งํํ๊ฒ ๋ ๊ฒฝ์ฐ v2 ๋ฟ ๋ง ์๋๋ผ ๊ธฐ์กด API ๋ด๋ถ ๊ตฌํ์ ๊ฑธ์น ๋ณ๊ฒฝ์ด ํ์ํ๋ฏ๋ก, v2 ์์ ์๋ฃ ํ ์ ๋ฐ์ ์ธ ๊ฒํ ๊ณผ์ ์ ์งํํ ๋ ๋ฆฌํฉํ ๋ง ์์ ์ ํ๋ ๋ฐฉํฅ์ผ๋ก ์งํํ๋๋ก ํ๊ฒ ์ต๋๋ค.