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

refactor: metadata in map[string]string #571

Merged
merged 12 commits into from
Aug 8, 2023
Merged

refactor: metadata in map[string]string #571

merged 12 commits into from
Aug 8, 2023

Conversation

woorui
Copy link
Collaborator

@woorui woorui commented Aug 2, 2023

Summary

Simplifying DataFrame struct, new features implementation will be easier.

Intended Outcome

Before, Metadata was encoded by y3 codec, it's a streaming codec used for reduce CPU workload in high load. But developers confused a lot when adding news features. After refactor Metadata to MsgPack, reduce the complexity.

How will it work?

Using map[string]string to store metadata as key-value pairs, and Using msgPack to encode and decode it for transmitting. The current definition of the DataFrame struct is as follows:

type DataFrame struct {
	// Tag is used for routing data.
	Tag Tag
	// Metadata stores additional data beyond the Payload,
	// it is an map[string]string{} that be encoded by msgpack.
	Metadata []byte
	// Payload is the data to transmit.
	Payload []byte
}

@woorui woorui self-assigned this Aug 2, 2023
@vercel
Copy link

vercel bot commented Aug 2, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
yomo ⬜️ Ignored (Inspect) Visit Preview Aug 7, 2023 7:43am

@codecov
Copy link

codecov bot commented Aug 2, 2023

Codecov Report

Merging #571 (18673df) into master (4e0845e) will increase coverage by 1.29%.
The diff coverage is 73.40%.

❗ Current head 18673df differs from pull request most recent head 12c60c4. Consider uploading reports for the commit 12c60c4 to get more accurate results

@@            Coverage Diff             @@
##           master     #571      +/-   ##
==========================================
+ Coverage   65.05%   66.35%   +1.29%     
==========================================
  Files          40       39       -1     
  Lines        2767     2749      -18     
==========================================
+ Hits         1800     1824      +24     
+ Misses        840      800      -40     
+ Partials      127      125       -2     
Files Changed Coverage Δ
core/client.go 77.88% <ø> (+4.48%) ⬆️
rx/runtime.go 0.00% <0.00%> (ø)
rx/stream_operator.go 32.68% <0.00%> (ø)
sfn.go 33.72% <0.00%> (ø)
zipper.go 72.41% <ø> (-0.47%) ⬇️
source.go 49.12% <28.57%> (-6.20%) ⬇️
core/context.go 74.69% <44.44%> (-13.37%) ⬇️
core/stream_group.go 75.28% <57.89%> (-4.27%) ⬇️
core/server.go 71.78% <69.56%> (+4.83%) ⬆️
core/auth/auth.go 100.00% <100.00%> (ø)
... and 7 more

... and 1 file with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

core/router/default.go Show resolved Hide resolved
@fanweixiao fanweixiao merged commit 0f7c6eb into master Aug 8, 2023
3 checks passed
@fanweixiao fanweixiao deleted the feat/metadata branch August 8, 2023 01:18
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.

2 participants