-
Notifications
You must be signed in to change notification settings - Fork 49
FEATURE: Add CompletableFuture Pipeline API #1035
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
7a9e90a to
0d98bc8
Compare
src/main/java/net/spy/memcached/protocol/ascii/PipelineOperationImpl.java
Outdated
Show resolved
Hide resolved
src/main/java/net/spy/memcached/protocol/ascii/PipelineOperationImpl.java
Show resolved
Hide resolved
| * NOTHING_TO_UPDATE, NOT_SUPPORTED | ||
| * or unknown statement | ||
| */ | ||
| atomicReference.get().set(index, status); |
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.
List<Object>λ‘ λ°ννλ κ²λ³΄λ€ PipelineResult ν΄λμ€λ₯Ό λ§λ€μ΄μ List<Boolean> νλμ Exception νλλ₯Ό λ£μ΄μ λ°ννλ κ²μ΄ λ«μ§ μλμ?
κ²°κ³Όλ₯Ό λ°μμ μ¬μ©νλ μͺ½μμ λ§€λ² νμ
체ν¬νκ³ νμ
λ³νμ νλ κ²λ³΄λ€ λμ κ² κ°μ΅λλ€.
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.
λ°ν νμ
μ λν΄ λ
Όμν΄λ³΄λ κ² μ’μ κ² κ°μ΅λλ€.
μ μν΄μ£Όμ κ²μ²λΌ λ³λ ν΄λμ€λ₯Ό λ§λ€κΈ°λ³΄λ€λ Map<Integer, CollectionOperationStatus>νμ
μ λ°νν΄μ μ€ν¨ μ causeλ§μ μ μ₯νλ건 μ΄λ€κ°μ? λͺ¨λ μ±κ³΅ν κ²½μ° Mapμ emptyκ° λ©λλ€.
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.
λ€λ₯Έ APIμμλ CollectionOperationStatusκ° μλ Exceptionμ λ°ννλ κ²μΌλ‘ λμ΄ μμ΅λλ€.
μ¬κΈ°μλ Map<Integer, Exception> νμ
μΌλ‘ λ°ννλ κ²μ μ΄λ€κ°μ?
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.
pipeλ multi key μ°μ°μ΄ λ μλ μμΌλ©° μ΄λ‘ μΈν΄ μμμ±, μμλ₯Ό 보μ₯ν μ μμ΅λλ€.
μλ₯Ό λ€μ΄ 500κ°μ λͺ
λ Ήμ νμ΄νλ‘ λ¬Άμ΄ execute λ©μλλ‘ μ€νμν€κ³ μ νκ³ , 5κ°μ λ
Έλμμ κ°κ° 100κ°μ© λͺ
λ Ήμ μ²λ¦¬νλ λμ€, νΉμ ν λ
Έλμμ 50λ²μ§Έ λͺ
λ Ήμ μλ¬κ° λ°μν΄ μ΄ν λͺ
λ Ήμ μ€ννμ§ μμμ λ μ΄λ₯Ό μ΄λ»κ² ννν μ§ κ²°μ ν΄μΌ ν©λλ€.
μ€νλΌμΈμΌλ‘ λ
Όμνμ λ λ€μκ³Ό κ°μ ν΄λμ€λ₯Ό λ°ννλ κ²μ μ μνλλ°, μ¬κΈ°μ μ€νλμ§ μμ λͺ
λ Ή μΈλ±μ€μλ NOT_EXECUTED OperationStatusλ₯Ό μ μ₯ν΄λλκ² μ’μ κ² κ°μ΅λλ€.
public class PipelineResult {
private final Map<Integer, OperationStatus> statusFailures;
private final Map<Integer, Throwable> exceptions;
}@uhm0311 λ€λ₯Έ μ μμ΄ μλ€λ©΄ μ½λ©νΈ λΆνλ립λλ€.
μ½λ μμ μ @jhpark816 λκΉμ§ νμΈν ν μ§ννκ² μ΅λλ€.
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.
@oliviarla @uhm0311
List<Object> μλ΅κ³Ό PipelineResult μλ΅ νμμμ μλ μ€λ₯ μμ μ΄λ»κ² νννκ² λλμ?
- ERROR|CLIENT_ERROR|SERVER_ERROR
- PIPE_ERROR
- opertion timeout
- cancel (by worker thread or io thread)
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.
- operation timeoutμ κ²½μ° complete λ‘μ§κ³Ό 무κ΄νλ―λ‘ μ΄ λ Όμμ μ°κ΄μ΄ μμ΅λλ€.
- cancelμ κ²½μ° νμ complete exceptionallyλκΈ° λλ¬Έμ μμΈλ λμΌμν©λλ€.
List<Object>
- νΉμ λ Έλμ λ³΄λΈ μλ΅μμ μλ¬κ° λ°μνμ§ μμλ€λ©΄, μλ΅ κ²°κ³Ό(true/false/OperationStatus)κ° Listμ μ μ₯λ©λλ€.
- νΉμ λ Έλμ λ³΄λΈ μλ΅μμ μλ¬κ° λ°μν κ²½μ°(cancel ν¬ν¨), ν΄λΉ λ Έλλ‘ λ³΄λλ λͺ¨λ μμ²μ λν΄ nullμ΄ Listμ μ μ₯λ©λλ€. κ° λ Έλλ‘ μμ²μ 보λ΄λ λ©μλμμ ArcusFutureImplλ₯Ό λ°ννκΈ° λλ¬Έμ, exceptionally completeλ κ²½μ° κ²°κ³Ό κ°μ νμΈν μ μκΈ° λλ¬Έμ΄μμ΅λλ€.
PipelineResult
- νΉμ λ Έλμ λ³΄λΈ μλ΅μμ μλ¬κ° λ°μνμ§ μμλ€λ©΄, μ€ν¨ μλ΅ κ²°κ³Ό(OperationStatus)κ° status Mapμ μ μ₯λ©λλ€.
- νΉμ λ
Έλμ λ³΄λΈ μλ΅μμ μλ¬κ° λ°μν κ²½μ°(cancel ν¬ν¨), μλ¬ λ΄λΆμ λ΄μλ <μ€ν¨ μλ΅ κ²°κ³Όμ μλ¬κ° λ°μν μμΉ>λ₯Ό ν λλ‘ μ€ν¨ μλ΅ κ²°κ³Όμ
NOT_EXECUTEDμνλ₯Ό status Mapμ μ μ₯νκ³ , μλ¬ μ체λ throwable Mapμ μ μ₯ν©λλ€.
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.
μλ΅ κ²°κ³Όλ₯Ό true, falseκ° μλ λͺ¨λ OperationStatusλ‘ λ¦¬ν΄νλ κ²μ μ΄λ€μ§?
λ°λΌμ, List<OperationStatus> 리ν΄νλ κ²μ μ΄λ€κ°μ?
μ€λ₯λ‘ μνλμ§ μμκ±°λ μν κ²°κ³Όλ₯Ό μ μ μμΌλ©΄, null μ μ₯νκ³ μ.
| }); | ||
| } | ||
|
|
||
| private Map<MemcachedNode, Map.Entry<List<KeyedOperation>, List<Integer>>> getOpsAndIndexesByNode( |
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.
μ΄ λ©μλμ getFutureToOriginIndexes()μμ μ¬μ©νλ μλ£κ΅¬μ‘°λ€μ΄ 볡μ‘ν κ² κ°μ΅λλ€.
κ° Entryμ Keyμ Valueλ₯Ό μμ λ³μμ λ΄μμ μ¬μ©νκ³ , μ΄λ€ μν μ νλ λ³μμΈμ§ μμλ³Ό μ μμΌλ©΄ μ’κ² μ΅λλ€.
π Related Issue
List<Object>μ κ° λͺ λ Ήμ λν μλ΅μ΄ λ΄κΈ΄λ€.β¨οΈ What I did