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 update readme #636

Merged
merged 6 commits into from
Dec 3, 2023
Merged

Java update readme #636

merged 6 commits into from
Dec 3, 2023

Conversation

acarbonetto
Copy link
Contributor

Issue #, if available: N/A

Description of changes:
Update the Java Client README.md to conform with other languages README templates.

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

Signed-off-by: Andrew Carbonetto <[email protected]>
Signed-off-by: Andrew Carbonetto <[email protected]>
java/README.md Outdated
1. A Java client (lib folder): wrapper to rust-client.
2. An examples script: to sanity test javababushka and similar java-clients against a redis host.
3. A benchmark app: to performance benchmark test javababushka and similar java-clients against a redis host.
Tested on Amazon Corretto version 11.0.21, and 17.0.3
Copy link
Collaborator

Choose a reason for hiding this comment

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

GHA uses Timurin SDK, you can referenct it too.
Mention which OS was tested on.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed in 2864a6e

java/README.md Outdated
- JDK 11+
- git
- protoc (protobuf compiler)
- Gradle
Copy link
Collaborator

Choose a reason for hiding this comment

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

gradle is not needed since we have gradlew

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed in 2864a6e

java/README.md Outdated
- JDK 11+
- git
- protoc (protobuf compiler)
- Gradle
Copy link
Collaborator

Choose a reason for hiding this comment

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

But rust is needed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point... let me add it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed in 2864a6e

java/README.md Outdated
Comment on lines 31 to 34
sudo apt-get install openjdk-11-jdk
VERSION=8.3
wget https://services.gradle.org/distributions/gradle-${VERSION}-bin.zip -P /tmp
sudo apt install -y protobuf-compiler
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
sudo apt-get install openjdk-11-jdk
VERSION=8.3
wget https://services.gradle.org/distributions/gradle-${VERSION}-bin.zip -P /tmp
sudo apt install -y protobuf-compiler
sudo apt-get install -y protobuf-compiler openjdk-11-jdk openssl gcc

last two are needed for rust and building rust dependencies

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed in 2864a6e

java/README.md Outdated Show resolved Hide resolved
java/README.md Outdated Show resolved Hide resolved
java/README.md Outdated Show resolved Hide resolved
java/README.md Outdated
Comment on lines 92 to 95
* `./gradle :client:test` to run client unit tests
* `./gradle :client:spotlessCheck` to check for codestyle issues
* `./gradle :client:spotlessApply` to apply codestyle recommendations
* `./gradle :benchmarks:run` to run performance benchmarks
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
* `./gradle :client:test` to run client unit tests
* `./gradle :client:spotlessCheck` to check for codestyle issues
* `./gradle :client:spotlessApply` to apply codestyle recommendations
* `./gradle :benchmarks:run` to run performance benchmarks
* `./gradlew :client:test` to run client unit tests
* `./gradlew :client:spotlessCheck` to check for codestyle issues
* `./gradlew :client:spotlessApply` to apply codestyle recommendations
* `./gradlew :benchmarks:run` to run performance benchmarks

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

$ ./gradle :client:test
BUILD SUCCESSFUL
```

Copy link
Collaborator

Choose a reason for hiding this comment

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

integTest?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We can add it later

java/README.md Outdated Show resolved Hide resolved
Copy link
Collaborator

@jonathanl-bq jonathanl-bq left a comment

Choose a reason for hiding this comment

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

I think it will be fine after Yury's comments have been addressed.

Signed-off-by: Andrew Carbonetto <[email protected]>
Signed-off-by: Andrew Carbonetto <[email protected]>
java/README.md Outdated

## Organization
The beta release of Babushka was tested on Intel x86_64 using Ubuntu 22.04.1, and amd64 using macOS 14.1.
Copy link
Collaborator

Choose a reason for hiding this comment

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

The Java wrapper won't be ready for the beta release, but we would have the java folder in the repository when we go public. So the README file should explain that the wrapper isn't ready yet and still a work in progress.
Lets remove the System Requirements, and avoid from saying that the java client was tested or is a part of the beta release - and instead lets add a Current Status section, explaining where we at.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok thanks. I've updated it, but please let me know what you think.

java/README.md Show resolved Hide resolved
java/README.md Outdated

## Code style
At the moment, the beta release of Babushka mush be build from source.
Copy link
Collaborator

Choose a reason for hiding this comment

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

it's not in beta yet, so it has to be built from source and not from package managers. lets change this sentence

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks. Please take a look at the updates if you can.

java/README.md Outdated
Client testClient = new Client();

public RedisClient() {
testClient.asyncConnectToRedis("localhost", 6379, false, false).get(); // expect Ok
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would expect to have a constructor only with host and port, so the user won't have to pass 'false' flags

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right. We have to implement that, but I've updated the readme to reflect what we want.
updated in eb00378

java/README.md Outdated

public RedisClient() {
testClient.asyncConnectToRedis("localhost", 6379, false, false).get(); // expect Ok
Response setResponse = testClient.asyncSet("name", "johnsmith").get(); // expect Ok
Copy link
Collaborator

Choose a reason for hiding this comment

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

minor: lets stick to 'foo', 'bar', to match the other readmes

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I used "key", "foobar".

java/README.md Outdated

Client testClient = new Client();

public RedisClient() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we remove the class and only include the client example, same as they do in Lettuce and Jedis?
https://github.com/lettuce-io/lettuce-core#basic-usage
https://github.com/redis/jedis#connecting-to-a-redis-cluster

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed in eb00378

java/README.md Outdated
public RedisClient() {
testClient.asyncConnectToRedis("localhost", 6379, false, false).get(); // expect Ok
Response setResponse = testClient.asyncSet("name", "johnsmith").get(); // expect Ok
Response getResponse = testClient.asyncGet("name").get(); // expect "johnsmith"
Copy link
Collaborator

Choose a reason for hiding this comment

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

maybe instead of adding as a comment, we can do same as lettuce did:

setResponse == "OK"
getResponse == "bar"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated in eb00378

java/README.md Outdated
* `host`: redis server host url
* `port`: redis server port number
* `tls`: redis TLS configured

### Troubleshooting
Copy link
Collaborator

Choose a reason for hiding this comment

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

this troubleshooting is not specific for Java. We will add a general troubleshooting to the main wiki later on. Lets remove it from the Java README

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed in eb00378

java/README.md Outdated
```
3. Generate protobuf files:
```bash
$ cd java/
Copy link
Collaborator

Choose a reason for hiding this comment

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

IMO removing the '$' and therefore also the 'BUILD SUCCESSFUL' will make it easier for users to copy the code to their terminals

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated in eb00378

Copy link
Collaborator

@barshaul barshaul left a comment

Choose a reason for hiding this comment

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

Overall looks good! Let's wait for our PM to approve the status message and then ship it

java/README.md Outdated
This module contains a Java-client wrapper that connects to the `Babushka`-rust-client. The rust client connects to
redis, while this wrapper provides Java-language binding. The objective of this wrapper is to provide a thin-wrapper
language api to enhance performance and limit cpu cycles at scale.
## Wrapper Status
Copy link
Collaborator

Choose a reason for hiding this comment

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

Notice: Java Wrapper - Work in Progress

We're excited to share that the Java client is currently in development! However, it's important to note that this client is a work in progress and is not yet complete or fully tested. Your contributions and feedback are highly encouraged as we work towards refining and improving this implementation. Thank you for your interest and understanding as we continue to develop this Java wrapper.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Lets wait for Mickey, Asaf and Shachar to approve

Copy link
Collaborator

Choose a reason for hiding this comment

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

Approved :)

Signed-off-by: Andrew Carbonetto <[email protected]>
@barshaul barshaul merged commit b6f1d22 into valkey-io:main Dec 3, 2023
@acarbonetto acarbonetto deleted the java_update_readme branch December 19, 2023 22:24
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.

4 participants