-
Notifications
You must be signed in to change notification settings - Fork 53
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
Java: Add BITFIELD
and BITFIELD_RO
commands
#1510
Java: Add BITFIELD
and BITFIELD_RO
commands
#1510
Conversation
d0ab6dc
to
1f7080e
Compare
java/client/src/main/java/glide/api/commands/BitmapBaseCommands.java
Outdated
Show resolved
Hide resolved
java/client/src/main/java/glide/api/commands/BitmapBaseCommands.java
Outdated
Show resolved
Hide resolved
java/client/src/main/java/glide/api/commands/BitmapBaseCommands.java
Outdated
Show resolved
Hide resolved
java/client/src/main/java/glide/api/commands/BitmapBaseCommands.java
Outdated
Show resolved
Hide resolved
java/client/src/main/java/glide/api/commands/BitmapBaseCommands.java
Outdated
Show resolved
Hide resolved
@@ -199,6 +199,8 @@ enum RequestType { | |||
XDel = 166; | |||
LMove = 168; | |||
BLMove = 169; | |||
BitField = 170; | |||
BitFieldReadOnly = 171; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should just keep it identical to the command
BitFieldReadOnly = 171; | |
BitField_Ro = 171; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure I agree with this, it doesn't seem java like to have camel case and underscore and ignore the acronym. Jedis names it similar for example https://javadoc.io/doc/redis.clients/jedis/4.2.3/redis/clients/jedis/commands/StringCommands.html#bitfieldReadonly-java.lang.String-java.lang.String...-.
Thoughts?
glide-core/src/request_type.rs
Outdated
@@ -169,6 +169,8 @@ pub enum RequestType { | |||
XDel = 166, | |||
LMove = 168, | |||
BLMove = 169, | |||
BitField = 170, | |||
BitFieldReadOnly = 171, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BitFieldReadOnly = 171, | |
BitField_Ro = 171, |
@@ -341,6 +343,8 @@ impl From<::protobuf::EnumOrUnknown<ProtobufRequestType>> for RequestType { | |||
ProtobufRequestType::XDel => RequestType::XDel, | |||
ProtobufRequestType::LMove => RequestType::LMove, | |||
ProtobufRequestType::BLMove => RequestType::BLMove, | |||
ProtobufRequestType::BitField => RequestType::BitField, | |||
ProtobufRequestType::BitFieldReadOnly => RequestType::BitFieldReadOnly, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ProtobufRequestType::BitFieldReadOnly => RequestType::BitFieldReadOnly, | |
ProtobufRequestType:: BitField_Ro => RequestType:: BitField_Ro, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@acarbonetto, why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The command is: bitfield_ro
We don't replace letters, for example: XDel
. Not XDelete
or StreamDelete
.
What's different about the _ro
?
@@ -509,6 +513,8 @@ impl RequestType { | |||
RequestType::XDel => Some(cmd("XDEL")), | |||
RequestType::LMove => Some(cmd("LMOVE")), | |||
RequestType::BLMove => Some(cmd("BLMOVE")), | |||
RequestType::BitField => Some(cmd("BITFIELD")), | |||
RequestType::BitFieldReadOnly => Some(cmd("BITFIELD_RO")), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RequestType::BitFieldReadOnly => Some(cmd("BITFIELD_RO")), | |
RequestType:: BitField_Ro => Some(cmd("BITFIELD_RO")), |
java/client/src/main/java/glide/api/models/commands/bitmap/BitFieldOptions.java
Outdated
Show resolved
Hide resolved
java/client/src/main/java/glide/api/models/commands/bitmap/BitFieldOptions.java
Outdated
Show resolved
Hide resolved
9d35be0
to
bc28f83
Compare
java/client/src/main/java/glide/api/models/commands/bitmap/BitFieldOptions.java
Outdated
Show resolved
Hide resolved
cf246aa
to
a579cbf
Compare
@@ -341,6 +343,8 @@ impl From<::protobuf::EnumOrUnknown<ProtobufRequestType>> for RequestType { | |||
ProtobufRequestType::XDel => RequestType::XDel, | |||
ProtobufRequestType::LMove => RequestType::LMove, | |||
ProtobufRequestType::BLMove => RequestType::BLMove, | |||
ProtobufRequestType::BitField => RequestType::BitField, | |||
ProtobufRequestType::BitFieldReadOnly => RequestType::BitFieldReadOnly, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@acarbonetto, why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TLDR
I trust you covered all possible and impossible cases
e2b0135
to
3733e22
Compare
* Java: Add `BITFIELD` and `BITFIELD_RO` command (#314) * Initial implementation for early review * Added javadocs and tests * Addressed comments * Fixed javadocs * Fixed link * Fixed javadocs * Addressed comments * Resolved conflicts * Addressed PR comments * Missed PR comment * Resolved conflicts * Addressed PR comments * Rebased * Improved import
Issue #, if available:
N/A
Description of changes:
Implements
BITFIELD
andBITFILED_RO
commands in the java client.By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.