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

feat(client): return events with log offset #160

Merged
merged 2 commits into from
Jul 25, 2022

Conversation

ZYunfeii
Copy link
Contributor

@ZYunfeii ZYunfeii commented Jul 22, 2022

What problem does this PR solve?

Issue Number: None

This PR adds offset information in cloud events.

Problem Summary

The client needs to use the offset information in events.

What is changed and how does it work?

  1. Add the "xvanusblockoffset" attribute to events when the segment server responds to the client's reading block request.
  2. In log_segment.go, take out the "xvanusblockoffset" attribute in events responded by the server then add the offset of segment. Finally, convert it into big-endian and set it to the new attribute "xvanuslogoffset" of event.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

@codecov
Copy link

codecov bot commented Jul 22, 2022

Codecov Report

Merging #160 (0058b88) into main (6ccf531) will increase coverage by 1.34%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #160      +/-   ##
==========================================
+ Coverage   57.97%   59.31%   +1.34%     
==========================================
  Files         102      102              
  Lines        9208     9218      +10     
==========================================
+ Hits         5338     5468     +130     
+ Misses       3483     3332     -151     
- Partials      387      418      +31     
Impacted Files Coverage Δ
internal/store/block/file/read.go 85.71% <100.00%> (+0.71%) ⬆️
internal/store/segment/server.go 35.58% <100.00%> (+22.69%) ⬆️
internal/store/segment/recovery.go 24.24% <0.00%> (+24.24%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6ccf531...0058b88. Read the comment docs.

@ifplusor ifplusor changed the title Yunfei feat: return events with log offset Jul 23, 2022
@ifplusor ifplusor marked this pull request as ready for review July 25, 2022 07:17
Copy link
Collaborator

@ifplusor ifplusor left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@wenfengwang wenfengwang left a comment

Choose a reason for hiding this comment

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

LGTM

@ifplusor ifplusor merged commit 6e0ad51 into vanus-labs:main Jul 25, 2022
@ifplusor ifplusor changed the title feat: return events with log offset feat(client): return events with log offset Jul 25, 2022
@ZYunfeii ZYunfeii deleted the yunfei branch August 11, 2022 08:01
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.

3 participants