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

doc(java-binding): add docs for running java-binding unit test #10304

Merged
merged 12 commits into from
Jun 25, 2023

Conversation

yufansong
Copy link
Member

@yufansong yufansong commented Jun 13, 2023

I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.

@yufansong yufansong requested review from tabVersion and wenym1 June 13, 2023 09:30
@github-actions github-actions bot added component/doc Issues about documentation. breaking-change labels Jun 13, 2023
@codecov
Copy link

codecov bot commented Jun 13, 2023

Codecov Report

Merging #10304 (1f29dc6) into main (890da24) will decrease coverage by 0.01%.
The diff coverage is n/a.

❗ Current head 1f29dc6 differs from pull request most recent head a0c350c. Consider uploading reports for the commit a0c350c to get more accurate results

@@            Coverage Diff             @@
##             main   #10304      +/-   ##
==========================================
- Coverage   70.48%   70.47%   -0.01%     
==========================================
  Files        1260     1260              
  Lines      215152   215152              
==========================================
- Hits       151643   151637       -6     
- Misses      63509    63515       +6     
Flag Coverage Δ
rust 70.47% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

see 7 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Contributor

@wenym1 wenym1 left a comment

Choose a reason for hiding this comment

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

Rest LGTM

@@ -0,0 +1,7 @@
RISINGWAVE_ROOT=$(git rev-parse --show-toplevel)
Copy link
Contributor

Choose a reason for hiding this comment

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

We already have a script to start the connector node service. java/connector-node/assembly/scripts/start-service.sh

@@ -34,6 +34,7 @@ Sometimes, you need to specify the shared library path. For example, when progra

```
RISINGWAVE_ROOT=$(git rev-parse --show-toplevel)
JAVA_ROOT=$RISINGWAVE_ROOT/java
CONNECTOR_ROOT=$JAVA_ROOT/connector-node
# Build shared library file
cd $RISINGWAVE_ROOT && cargo build -p risingwave_java_binding
Copy link
Contributor

Choose a reason for hiding this comment

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

In the latest main, we don't need to explicit build the rust java_binding. Could you help to update this doc?

Copy link
Member Author

Choose a reason for hiding this comment

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

do you mean we do not need cargo build -p risingwave_java_binding ? I thought we need to make sure shared library exist and specify at Djava.library.path.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, we don't need it. In #10229, the shared library will be built and added to the jar during maven build, and the shared library can be loaded from the java, so the we don't need to set the java.library.path now.

Downloading and launching MinIO is a straightforward process. For PostgreSQL, I recommend launching it using Docker. When setting up PostgreSQL, please ensure that the values for `POSTGRES_PASSWORD`, `POSTGRES_DB`, and `POSTGRES_USER` match the corresponding settings in the `integration_tests.py` file.

```shell
docker run --name my-postgres -e POSTGRES_PASSWORD=connector -e POSTGRES_DB=test -e POSTGRES_USER=test -d -p 5432:5432 postgres
Copy link
Contributor

Choose a reason for hiding this comment

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

We may include a sample SQL that can create a sink to the pg instance launched from this command.

Copy link
Member Author

Choose a reason for hiding this comment

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

You mean like this?

Copy link
Contributor

Choose a reason for hiding this comment

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

yes.

@yufansong yufansong force-pushed the docs/java-binding branch from d18e8e5 to e99fa67 Compare June 19, 2023 08:16

If you encounter an error stating that the program cannot access the library, it may be due to merging new features or outdated documentation. In such cases, you will need to manually build the corresponding Java shared library file.

After building the shared library file, move it into the `java/connector-node/assembly/target directory`, make sure to specify the shared library path using the `-Djava.library.path=java/connector-node/assembly/target` flag. This tells Java where to find the required shared library files.
Copy link
Contributor

Choose a reason for hiding this comment

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

These paragraph is unnecessary. Anyone successfully build the maven project should be able to run. We don't need explicitly building the shared library any more.

Copy link
Member Author

Choose a reason for hiding this comment

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

removed

@github-actions github-actions bot added the user-facing-changes Contains changes that are visible to users label Jun 25, 2023
@yufansong yufansong removed the user-facing-changes Contains changes that are visible to users label Jun 25, 2023
@github-actions github-actions bot added the user-facing-changes Contains changes that are visible to users label Jun 25, 2023
@yufansong yufansong enabled auto-merge June 25, 2023 07:06
@yufansong yufansong added this pull request to the merge queue Jun 25, 2023
Merged via the queue into main with commit f885259 Jun 25, 2023
@yufansong yufansong deleted the docs/java-binding branch June 25, 2023 07:22
@CharlieSYH CharlieSYH added the 📖✗ No user documentation is needed. label Jul 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/doc Issues about documentation. user-facing-changes Contains changes that are visible to users 📖✗ No user documentation is needed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants