Repository navigation
INTERNAL: Parse vop command lines - #8
ing-eoking wants to merge 1 commit into
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
| Layer / File(s) | Summary |
|---|---|
FFI 토큰 입력 src/protocol/tokens.rs |
token_t 배열을 빌려 쓰는 Tokens 래퍼와 테스트용 토크나이저를 추가했습니다. |
요청 파싱 src/protocol.rs |
요청 타입과 명령별 파서를 추가했습니다. 생성 매개변수, 옵션, 필터 길이, 검색 결과 수 등을 검증하고, 관련 테스트를 추가했습니다. |
ASCII 명령 처리 src/ascii.rs |
vop 명령만 수락하는 ASCII 디스크립터와 콜백을 추가했습니다. 파싱 성공과 실패에 따라 각각 NOT_SUPPORTED와 CLIENT_ERROR를 전송합니다. 패닉 상태와 응답 콜백 실패도 처리합니다. |
확장 초기화 및 등록 src/lib.rs |
C ABI 초기화 진입점에서 필요한 API와 등록 함수를 확인하고 ASCII 프로토콜 디스크립터를 등록합니다. 초기화 중 패닉과 등록 실패에는 fatal 오류 코드를 반환합니다. |
Priority:
Estimated code review effort: 4 (Complex) | ~45 minutes
Change: Feature
Sequence Diagram(s)
sequenceDiagram
participant memcached
participant accept
participant execute
participant parse
participant response_handler
memcached->>accept: vop 토큰 전달
accept-->>memcached: 명령 수락 여부 반환
memcached->>execute: 수락한 명령 실행
execute->>parse: 토큰 파싱 요청
parse-->>execute: Request 또는 Error 반환
execute->>response_handler: NOT_SUPPORTED 또는 CLIENT_ERROR 전송
response_handler-->>execute: 응답 호출 결과 반환
Possibly related PRs
- jam2in/arcus-vector#1:
cdylib설정과 memcached의 라이브러리 로딩 계약을 추가합니다. 이 PR의 확장 초기화 진입점은 해당 로딩 경로에서 사용됩니다. - jam2in/arcus-vector#3: memcached 헤더에서 생성한 FFI 타입을 제공합니다. 이 PR은 초기화와 ASCII 명령 처리에 해당 타입을 사용합니다.
Suggested reviewers: zhy2on, jhpark816
Merge Risk: 
Moderate · up to 1d933
-
Fix the request-path allocation risk and reject duplicate create options before merging; memory pressure could otherwise terminate memcached, and duplicate options are accepted contrary to the command contract.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passed -
Finishing Touches: 💡 1
-
📝 Generate docstrings: 💡
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands.
🔗 Related Issue
⌨️ What I did
vop명령줄을 파싱해 형식을 검사합니다.지원하는 명령줄
검사 항목
하이퍼 파라미터의 경우 너무 큰 수치를 주면 성능저하가 발생하여 우선 MAX치를 지정했습니다.
(문서는 추후에 추가할 예정입니다.)
createcreatemetric·quantb1은 hamming·tanimoto 전용, hamming·tanimoto는b1필수searchi32::MAX, filter 4096바이트 이하각 모듈 별 역할
src/protocol/tokens.rs: memcached가 넘긴 토큰 배열을 읽는Tokens.unsafe는 생성자에만 있습니다.src/protocol.rs: vop 명령줄의 문법을 다룸. 토큰을 읽어 하위 명령과 인자를 확인tokens.rs: 토큰 배열(C 포인터)을 Rust에서 안전하게 읽게 해줍니다.Summary by CodeRabbit
vop명령을 처리하며, 생성·업서트·메타데이터·검색 등 관련 명령의 형식과 매개변수를 확인합니다.