Skip to content
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

implements 'scan' command #4

Open
wants to merge 18 commits into
base: master
Choose a base branch
from
Open

implements 'scan' command #4

wants to merge 18 commits into from

Conversation

yjh0502
Copy link
Contributor

@yjh0502 yjh0502 commented Jul 25, 2016

Implements 'scan' command which receives three paramaters

  • table: table name
  • options: Erlang proplist to specify scan options.
  • ref: Erlang reference to distinguish rows from multiple scans

API returns ok after starting scan asyncronously. It returns each rows
with {Ref, row, [ColumnList]} messages for each cells. If there is an
error occures during scan, it sends {Ref, error, Name, Msg} and
terminates scan. If all rows are successfully returned, it sends {Ref, done} message.

note: This PR implements proof-of-concept mechanism of scan command. Any comments/reviews/feedbacks are welcome. Here's some ideas

  • {Ref, {error, Name, Msg}} might be better than {Ref, error, Name, Msg} because we can use single error handling function for both scan and get. Same for other messages.
  • It sends single message for each rows, and there might be performance problem when handling multiple small rows. {Ref, row, [Rows]} might be better
  • There are some redundent messages on row message. For example, we don't need to specify table name because we know it already.

Implements 'scan' command which receives three paramaters

 - table: table name
 - options: Erlang proplist to specify scan options.
 - ref: Erlang reference to distinguish rows from multiple scans

API returns `ok` after starting scan asyncronously. It returns each rows
with {Ref, row, [ColumnList]} messages for each cells. If there is an
error occures during scan, it sends {Ref, error, Name, Msg} and
terminates scan. If all rows are successfully returned, it sends {Ref,
done} message.
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.

1 participant