marceloboeira / voik

♒︎ [WIP] An experimental ~distributed~ commit-log
MIT License
255 stars 25 forks source link

Add reader api - issue #5 #14

Closed cuichenli closed 5 years ago

cuichenli commented 5 years ago

A draft API for reader interface. Changes:

  1. Add field current_segment in commit_log as pointer to current segment.
  2. Add method read_after which takes in a position: Position and offset. It will read the log that is offset after position
  3. Add method read which call read_after(position, 0)
  4. Add struct Record which has two fields current_offset and segment. Implements record, position, record_after, and next.
  5. Add enum Position
marceloboeira commented 5 years ago

@cuichenli awesome, I’ll have a proper look at it later today! Thanks!

cuichenli commented 5 years ago

@marceloboeira I am glad you like it. I think for this PR I will continue to make changes on Record and RecordReader. As for unit test and benchmark and other changes, I will open another separate PRs to take care of them. Is that OK?

marceloboeira commented 5 years ago

@cuichenli let's merge it this way and we can change later on!

cuichenli commented 5 years ago

@marceloboeira Cool, should I file another issue?

marceloboeira commented 5 years ago

we can continue working on the same #5, no worry.