feat(golang): meta string encoding algorithm in golang#1566
Merged
chaokunyang merged 14 commits intoapache:mainfrom Apr 27, 2024
Merged
feat(golang): meta string encoding algorithm in golang#1566chaokunyang merged 14 commits intoapache:mainfrom
chaokunyang merged 14 commits intoapache:mainfrom
Conversation
Collaborator
|
This is great! CI has some failure, could you rebase main branch? |
Contributor
Author
|
Actually I don't know how to restart CI tasks |
b6a6fc9 to
2f062b6
Compare
Contributor
Author
|
I have rebased main branch, please review this PR. |
chaokunyang
reviewed
Apr 24, 2024
chaokunyang
reviewed
Apr 24, 2024
chaokunyang
reviewed
Apr 24, 2024
chaokunyang
reviewed
Apr 24, 2024
go/fury/meta/meta_string_encoder.go
Outdated
| specialChar1: e.specialChar1, | ||
| specialChar2: e.specialChar2, | ||
| outputBytes: e.EncodeLowerUpperDigitSpecial(input), | ||
| numChars: length, |
Collaborator
There was a problem hiding this comment.
I removed the needs for numChars/numBits in #1565 , maybe we can simplify the implement a little.
Contributor
Author
There was a problem hiding this comment.
okay, I'll read and implement it.
go/fury/meta/meta_string_decoder.go
Outdated
| // Retrieve 5 bits every iteration from data, convert them to characters, and save them to chars | ||
| // "abc" encoded as [00000] [000,01] [00010] [0, corresponding to three bytes, which are 0, 68, 0 (68 = 64 + 4) | ||
| // In order, take the highest digit first, then the lower | ||
| chars := make([]byte, 0) |
Contributor
There was a problem hiding this comment.
Hi @qingoba , first of all thanks for your contribution to Fury.
Could we specify the capacity when initializing chars to avoid the performance degradation caused by slice expansion?
2 tasks
2f062b6 to
8a62500
Compare
chaokunyang
reviewed
Apr 26, 2024
go/fury/meta/meta_string_test.go
Outdated
| "HelloWorld__123.2024": 6, | ||
| "MediaContent": 5, | ||
| "Apple_banana": 5, | ||
| "欲海回狂": 0, // not used |
Collaborator
There was a problem hiding this comment.
How about replacing it to "你好,世界"
chaokunyang
reviewed
Apr 26, 2024
chaokunyang
reviewed
Apr 26, 2024
Co-authored-by: Shawn Yang <chaokunyang@apache.org>
Co-authored-by: Shawn Yang <chaokunyang@apache.org>
Collaborator
|
@qingoba Ci has some failures. Could you take a look? |
go/fury/meta/meta_string_test.go
Outdated
| "HelloWorld__123.2024": 6, | ||
| "MediaContent": 5, | ||
| "Apple_banana": 5, | ||
| "你好,世界": 0, // not used |
go/fury/meta/meta_string_test.go
Outdated
| "MediaContent": ALL_TO_LOWER_SPECIAL, | ||
| "HelloWorld__123.2024": LOWER_UPPER_DIGIT_SPECIAL, | ||
| "Apple_banana": FIRST_TO_LOWER_SPECIAL, | ||
| "你好,世界": UTF_8, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
This PR implements meta string encoding described in xlang serialization spec
Related issues
Does this PR introduce any user-facing change?