Skip to content

Conversation

@oliviarla
Copy link
Collaborator

@oliviarla oliviarla commented Dec 23, 2025

πŸ”— Related Issue

  • Pipeline APIλ₯Ό μΆ”κ°€ν•©λ‹ˆλ‹€.
  • μ‚¬μš© 방법
    • Pipeline 객체λ₯Ό μƒμ„±ν•˜μ—¬ ν•˜λ‚˜μ˜ νŒŒμ΄ν”„λΌμΈμœΌλ‘œ 포함할 λͺ…령듀을 μ‘°ν•©ν•œλ‹€.
    • νŒŒμ΄ν”„λΌμΈμ— 포함할 수 μžˆλŠ” λͺ…령듀을 μ œν•œν•  수 μžˆλ‹€. (λͺ…λ Ήμ–΄μ˜ μ’…λ₯˜, 개수)
    • λͺ…λ Ήμ–΄μ˜ κ°œμˆ˜λŠ” μ΅œλŒ€ 500개둜 μ œν•œν•œλ‹€. 이λ₯Ό 톡해 ν•œ λ…Έλ“œμ—λŠ” μ΅œλŒ€ ν•˜λ‚˜μ˜ νŒŒμ΄ν”„λΌμΈμ΄ 보내진닀.
    public class Pipeline<V> {
    
        // λ‹€μ–‘ν•œ λͺ…령을 포함할 수 μžˆλŠ” PipelineOperationImpl νƒ€μž…μ„ value에 μ €μž₯ν•œλ‹€.
        private Map<MemcachedNode, Operation> ops;
        
        public Pipeline() {
          // ...
        }
        
        public Pipeline<V> lopInsert(String key, int index, V value) {
          // ...
          return this;
        }
        
        public Pipeline<V> mopInsert(String key, String mkey, V value) {
          // ...
          return this;
        }
        
        // ...
        
    }
    • λͺ…λ Ήμ˜ μ‘°ν•© μˆœμ„œλŒ€λ‘œ νŒŒμ΄ν”„λΌμΈμ΄ λ§Œλ“€μ–΄μ§€μ§€λ§Œ, μ„œλ²„μ—μ„œ 처리 도쀑 λ‹€λ₯Έ 연산이 끼어듀 수 μžˆλ‹€.
    • μ„œλ‘œ λ‹€λ₯Έ μ—¬λŸ¬ ν‚€λ₯Ό νŒŒμ΄ν”„λΌμΈμ— ν¬ν•¨ν•˜λŠ” 경우, 각 λ…Έλ“œ λ³„λ‘œ νŒŒμ΄ν”„λΌμΈμ΄ μƒμ„±λ˜μ–΄ λ…Έλ“œμ— μ „λ‹¬λœλ‹€.
    • Pipeline 객체λ₯Ό execute λ©”μ„œλ“œμ— λ„˜κ²¨μ•Ό νŒŒμ΄ν”„λΌμΈμ΄ μˆ˜ν–‰λ˜λ©°, List<Object> 에 각 λͺ…령에 λŒ€ν•œ 응닡이 λ‹΄κΈ΄λ‹€.
    ArcusFuture<List<Object>> execute(Pipeline<T> pipeline)

⌨️ What I did

  • μ˜ˆμ™Έ 처리
    • λͺ¨λ“  응닡이 올 λ•Œ κΉŒμ§€ κΈ°λ‹€λ¦° ν›„ μ—¬λŸ¬ μš”μ²­μ—μ„œ λ°œμƒν•œ μ‹€νŒ¨/μ—λŸ¬λ“€μ„ ν•˜λ‚˜μ˜ CompositeException νƒ€μž…μœΌλ‘œ λͺ¨μ•„ λ˜μ§„λ‹€.
  • switchover 처리
    • responseIndexλ₯Ό μ‚¬μš©ν•˜μ—¬ 아직 응닡이 μ˜€μ§€ μ•Šμ€ operationλ“€λ§Œ μƒˆλ‘œμš΄ master λ…Έλ“œμ—μ„œ initializeν•  λ•Œ ν¬ν•¨λ˜λ„λ‘ ν•œλ‹€.
  • migration 처리
    • gotStatus λ©”μ„œλ“œμ˜ 인자둜 Operation을 λ°›μ•„, μ—¬λŸ¬ Operation으둜 λΆ„λ¦¬λ˜λ”λΌλ„ 원본 μ½œλ°±μ—μ„œ 원본 index에 값을 μΆ”κ°€ν•  수 μžˆλ„λ‘ ν•œλ‹€.

buffer.reset();

String command = new String(bufferBytes);
String modifiedCommand = command.replaceAll("\\s+pipe\\r\\n", "\r\n");
Copy link
Collaborator

Choose a reason for hiding this comment

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

value 뢀뢄에 \\s+pipe\\r\\nκ°€ λ“€μ–΄κ°ˆ κ°€λŠ₯성이 μžˆμŠ΅λ‹ˆλ‹€.
ifλ¬Έμ—μ„œ endsWith()으둜 κ²€μ‚¬ν•˜λŠ” λ‘œμ§μ„ μΆ”κ°€ν•©μ‹œλ‹€.

}

// Notify callback with current response index
cb.gotStatus(ops.get(responseIndex), status);
Copy link
Collaborator

Choose a reason for hiding this comment

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

여기에 op 객체 말고 responseIndexλ₯Ό κ·Έλƒ₯ λ„˜κΈ°λ©΄ μ•ˆλ˜λ‚˜μš”?

* NOTHING_TO_UPDATE, NOT_SUPPORTED
* or unknown statement
*/
atomicReference.get().set(index, status);
Copy link
Collaborator

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 ν•„λ“œλ₯Ό λ„£μ–΄μ„œ λ°˜ν™˜ν•˜λŠ” 것이 λ‚«μ§€ μ•Šλ‚˜μš”?
κ²°κ³Όλ₯Ό λ°›μ•„μ„œ μ‚¬μš©ν•˜λŠ” μͺ½μ—μ„œ 맀번 νƒ€μž… μ²΄ν¬ν•˜κ³  νƒ€μž… λ³€ν™˜μ„ ν•˜λŠ” 것보닀 λ‚˜μ„ 것 κ°™μŠ΅λ‹ˆλ‹€.

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