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

Java: Add XADD command (Stream commands) #1209

Merged
merged 8 commits into from
Apr 4, 2024

Conversation

acarbonetto
Copy link
Contributor

@acarbonetto acarbonetto commented Apr 1, 2024

Issue #, if available:

Description of changes:

Add xadd command

Example:

// without options
String streamId = client.xadd("key", Map.of("name", "Sara", "surname", "OConnor").get();
System.out.println("Stream: " + streamId);

// with Options 
// Option to use the existing stream, or return null if the stream doesn't already exist at "key"
StreamAddOptions options = StreamAddOptions.builder().id("sid").makeStream(Boolean.FALSE).build();
String streamId = client.xadd("key", Map.of("name", "Sara", "surname", "OConnor"), options).get();
if (streamId != null) {
    assert streamId.equals("sid");
}

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@acarbonetto acarbonetto requested a review from a team as a code owner April 1, 2024 19:46
@acarbonetto acarbonetto added the java issues and fixes related to the java client label Apr 1, 2024
@acarbonetto acarbonetto force-pushed the java/integ_acarbo_add_xadd branch from 3b6987c to dd26bd3 Compare April 1, 2024 20:07
Copy link
Collaborator

@Yury-Fridlyand Yury-Fridlyand left a comment

Choose a reason for hiding this comment

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

Transaction IT is missing

@Yury-Fridlyand
Copy link
Collaborator

Please, update IT for type: https://github.com/aws/glide-for-redis/blob/961a1bb91bda110f7ea4865c37809aebfdd5b970/java/integTest/src/test/java/glide/SharedCommandTests.java#L1192-L1193

Copy link
Collaborator

@Yury-Fridlyand Yury-Fridlyand left a comment

Choose a reason for hiding this comment

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

  1. Fix merge conflicts
  2. Transaction IT is missing. With ID option you can define the return value I think.

@acarbonetto acarbonetto force-pushed the java/integ_acarbo_add_xadd branch from 292a4a9 to 59c1edd Compare April 3, 2024 23:44
@Elen-Ghulam Elen-Ghulam removed their assignment Apr 4, 2024
@Yury-Fridlyand
Copy link
Collaborator

@acarbonetto please resolve conlicts

@acarbonetto acarbonetto force-pushed the java/integ_acarbo_add_xadd branch from 59c1edd to ba3514a Compare April 4, 2024 20:21
acarbonetto and others added 8 commits April 4, 2024 13:31
* Add Stream XADD command to Java

Signed-off-by: Andrew Carbonetto <[email protected]>

---------

Signed-off-by: Andrew Carbonetto <[email protected]>
* Java: Add Zpopmax command. (Sorted Set Commands) (#149)

* Minor documentation update.

* Minor test update.

* Spotless

Signed-off-by: Andrew Carbonetto <[email protected]>

* Minor documentation update.

* Rebase + Spotless

---------

Signed-off-by: Andrew Carbonetto <[email protected]>
Co-authored-by: Andrew Carbonetto <[email protected]>
Signed-off-by: Andrew Carbonetto <[email protected]>
Signed-off-by: Andrew Carbonetto <[email protected]>
Signed-off-by: Andrew Carbonetto <[email protected]>
Signed-off-by: Andrew Carbonetto <[email protected]>
Signed-off-by: Andrew Carbonetto <[email protected]>
Signed-off-by: Andrew Carbonetto <[email protected]>
@acarbonetto acarbonetto force-pushed the java/integ_acarbo_add_xadd branch from ba3514a to 9c3a174 Compare April 4, 2024 20:32
@Yury-Fridlyand Yury-Fridlyand merged commit dde7760 into valkey-io:main Apr 4, 2024
12 checks passed
@Yury-Fridlyand Yury-Fridlyand deleted the java/integ_acarbo_add_xadd branch April 4, 2024 20:51
shohamazon pushed a commit to adanWattad/glide-for-redis that referenced this pull request Apr 9, 2024
* Java: Add XADD command (Stream commands) (valkey-io#155)

Signed-off-by: Andrew Carbonetto <[email protected]>
Co-authored-by: SanHalacogluImproving <[email protected]>
cyip10 pushed a commit to Bit-Quill/valkey-glide that referenced this pull request Jun 24, 2024
* Java: Add XADD command (Stream commands) (#155)

Signed-off-by: Andrew Carbonetto <[email protected]>
Co-authored-by: SanHalacogluImproving <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
java issues and fixes related to the java client
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants