paust-team / paust-db

GNU General Public License v3.0
6 stars 5 forks source link

Implement multi data transaction for client #25

Closed dragon0170 closed 5 years ago

dragon0170 commented 5 years ago

Reference

24

code-to-gold commented 5 years ago

파일을 보낼 때는 -f 옵션과 같은게 있으면 좋을 것 같구요, 나중에는 디렉토리 내부의 파일들 전체를 보내는 경우도 있을 것 같네요. 이 부분도 염두에 두시면 좋을 것 같습니다.

또한, 한번에 너무 여러개의 데이터들을 트랙잭션으로 태우면 문제가 될 수 있으니, 일정 사이즈 기준으로 chunk하는 방식도 염두에 두시면 좋습니다.

dragon0170 commented 5 years ago

@code-to-gold 파일을 보내는 커맨드를 아래 두가지 중 어느 것으로 하는 게 좋을까요? 처음 생각했던 것은 2번 방식이었는데 write라는 명령어에서 바로 사용하는 1번 방식이 더 직관적인 것 같네요.

  1. write 커맨드에 -f 옵션 추가 paust-db client write -f /my/file.json
  2. import 커맨드 추가 paust-db client import /my/file.json
code-to-gold commented 5 years ago

저도 1번이 더 좋을것 같습니다.

dragon0170 commented 5 years ago

Working branch

1dennispark commented 5 years ago

파일을 보내는 방식에 대해서는 파일 이름을 받는 것도 있지만, STDIN을 통해서 직접 스트림을 받는 방식도 있습니다.

dragon0170 commented 5 years ago

@co1god STDIN을 통해 입력받을 경우에는 어떤 방식으로 입력의 끝을 알릴 수 있을까요? data라는 json object의 배열을 입력받을 것이니 ']'이 입력될 때까지의 데이터를 모두 받는 것도 하나의 방법이라고 생각합니다.

1dennispark commented 5 years ago

그냥 EOF까지 입력 받으시면 됩니다.

파이프로 받을때는 알아서 이전 프로세스가 끝날때 EOF가 뜰거구요.

직접 입력의경우엔 ctrl+d 를 하면 EOF가 전달되며 입력이 끝납니다.

2018년 12월 19일 (수) 오전 11:25, dragon0170 notifications@github.com님이 작성:

@co1god https://github.com/co1god STDIN을 통해 입력받을 경우에는 어떤 방식으로 입력의 끝을 알릴 수 있을까요? data라는 json object의 배열을 입력받을 것이니 ']'이 입력될 때까지의 데이터를 모두 받는 것도 하나의 방법이라고 생각합니다.

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/paust-team/paust-db/issues/25#issuecomment-448446299, or mute the thread https://github.com/notifications/unsubscribe-auth/AqM4SkqHdGrRQRLdKzQlekgbtKvnJqTmks5u6aOUgaJpZM4ZVryb .

dragon0170 commented 5 years ago

STDIN으로 json data를 받는 방식은 만약에 필요하다면 #27, #29 의 ABCI query를 보낼 때도 사용할 수 있어 보입니다.