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(store): replace all 4 objects maps with gokv.Store abstraction #177

Merged
merged 7 commits into from
Oct 19, 2023

Conversation

glimchb
Copy link
Member

@glimchb glimchb commented Sep 12, 2023

@codecov
Copy link

codecov bot commented Sep 12, 2023

Codecov Report

Merging #177 (1769edf) into main (dda8c55) will decrease coverage by 6.87%.
The diff coverage is 29.05%.

@@            Coverage Diff             @@
##             main     #177      +/-   ##
==========================================
- Coverage   65.21%   58.34%   -6.87%     
==========================================
  Files          19       20       +1     
  Lines        1374     1575     +201     
==========================================
+ Hits          896      919      +23     
- Misses        434      570     +136     
- Partials       44       86      +42     
Files Coverage Δ
pkg/evpn/evpn.go 84.84% <100.00%> (-0.66%) ⬇️
pkg/utils/codec.go 0.00% <0.00%> (ø)
pkg/evpn/bridge.go 56.12% <30.76%> (-15.18%) ⬇️
pkg/evpn/vrf.go 54.76% <29.62%> (-13.21%) ⬇️
pkg/evpn/port.go 65.38% <30.76%> (-13.97%) ⬇️
pkg/evpn/svi.go 48.44% <26.96%> (-16.08%) ⬇️

@artek-koltun
Copy link
Contributor

@glimchb I think that the chosen library gokv have some disadvantages: It is not updated since 2020. It contains only 11 commits, 0 forks and 0 stars. So there is no active community maintaining it. This entails the risks: What if we have a bug there, or we need some additional feature? Who would do that work? Add/fix the functionality on our own? But I suppose we need a library to offload that job
I found gofiber/storage project. It is maintained. It has 211 stars. Furthermore, it has a discord channel, so we can reach out for help if needed. In addition, it supports a broader set of storage backends. Would it be better to depend on that library instead of gokv?

Comment on lines 460 to 463
options := gomap.DefaultOptions
options.Codec = utils.ProtoCodec{}
store := gomap.NewStore(options)
opi := NewServerWithArgs(mockNetlink, store)
Copy link

@brianroch brianroch Sep 18, 2023

Choose a reason for hiding this comment

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

Bit of repetition here, could this be extracted to a function? Same across the rest of the test packages.

@artek-koltun
Copy link
Contributor

@glimchb I think that the chosen library gokv have some disadvantages: It is not updated since 2020. It contains only 11 commits, 0 forks and 0 stars. So there is no active community maintaining it. This entails the risks: What if we have a bug there, or we need some additional feature? Who would do that work? Add/fix the functionality on our own? But I suppose we need a library to offload that job I found gofiber/storage project. It is maintained. It has 211 stars. Furthermore, it has a discord channel, so we can reach out for help if needed. In addition, it supports a broader set of storage backends. Would it be better to depend on that library instead of gokv?

ok, my oversight. messed up with repository and referred to https://github.com/yifeng01/gokv
https://github.com/philippgille/gokv repo looks ok

@glimchb glimchb changed the title feat(store): use gokv pkg to abstract persistant store feat(store): replace all 4 objects maps with gokv.Store abstraction Oct 17, 2023
Signed-off-by: Boris Glimcher <Boris.Glimcher@emc.com>
Signed-off-by: Boris Glimcher <Boris.Glimcher@emc.com>
Signed-off-by: Boris Glimcher <Boris.Glimcher@emc.com>
Signed-off-by: Boris Glimcher <Boris.Glimcher@emc.com>
Signed-off-by: Boris Glimcher <Boris.Glimcher@emc.com>
until gokv implements GetAll() interface
added volatile helper for listing of keys

Signed-off-by: Boris Glimcher <Boris.Glimcher@emc.com>
Signed-off-by: Boris Glimcher <Boris.Glimcher@emc.com>
@glimchb glimchb marked this pull request as ready for review October 19, 2023 18:08
@glimchb glimchb requested a review from a team as a code owner October 19, 2023 18:08
@glimchb glimchb merged commit cdb8b5e into opiproject:main Oct 19, 2023
16 of 18 checks passed
@glimchb glimchb deleted the gokv branch October 19, 2023 18:09
Pagination map[string]int
ListHelper map[string]bool
Copy link
Contributor

Choose a reason for hiding this comment

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

@glimchb since ListHelper is used as a set, it is more optimal to use struct{} as a value to save up 1 byte per entry (empty struct occupies 0 bytes).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat(store): use gokv pkg to abstract persistant store
3 participants