Skip to content

Conversation

@TremblingV5
Copy link
Contributor

This PR is related with #517

  • Do some modifications for update function merged days before to improve reusability of code
  • Add SetBit and GetBit

SetBit

  • If set to a non-exist key, it will create this key and corresponding value. The value will composed of offset bits of \x00 and 1 bit of the give byte.
  • If set to a exist key, and the value have a bigger size than the given offset. It will modify the corresponding bit.
  • If set to a exist key, but the value have a smaller size than the given offset. It will add some \x00 and modify the right bit to the given byte

GetBit

  • If get with a non-exist key, it will throw a key not found error.
  • If get with a exist key and the value have a bigger size than the given offset. It will return the corresponding bit
  • If get with a exist key but the value have a smaller size than the given offset. It will return \x00. (This is same with GETBIT of redis)

@TremblingV5 TremblingV5 force-pushed the implements_of_getbit_and_setbit branch 2 times, most recently from a7f874c to 73edfbb Compare December 11, 2023 15:24
@codecov
Copy link

codecov bot commented Dec 11, 2023

Codecov Report

Attention: 6 lines in your changes are missing coverage. Please review.

Comparison is base (0193fd9) 70.35% compared to head (4c79d09) 70.52%.

❗ Current head 4c79d09 differs from pull request most recent head c365262. Consider uploading reports for the commit c365262 to get more accurate results

Files Patch % Lines
tx_btree.go 87.75% 4 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #539      +/-   ##
==========================================
+ Coverage   70.35%   70.52%   +0.16%     
==========================================
  Files          36       36              
  Lines        5364     5397      +33     
==========================================
+ Hits         3774     3806      +32     
+ Misses       1203     1202       -1     
- Partials      387      389       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@TremblingV5 TremblingV5 force-pushed the implements_of_getbit_and_setbit branch 2 times, most recently from d3a84ae to 4c79d09 Compare December 11, 2023 15:53
@TremblingV5 TremblingV5 marked this pull request as ready for review December 11, 2023 16:05
@bigboss2063
Copy link
Member

Hi, just a reminder. Don't forget update doc and example 😁.

@TremblingV5 TremblingV5 force-pushed the implements_of_getbit_and_setbit branch from 73af4ff to c365262 Compare December 13, 2023 16:10
@TremblingV5
Copy link
Contributor Author

TremblingV5 commented Dec 13, 2023

Hi, just a reminder. Don't forget update doc and example 😁.

Hi, I've updated documents and examples. How do you think about them

Copy link
Member

@bigboss2063 bigboss2063 left a comment

Choose a reason for hiding this comment

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

LGTM! It's a very Detailed. Thank you for your contribution!

@bigboss2063 bigboss2063 merged commit 1002625 into nutsdb:master Dec 13, 2023
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