Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
heziai authored Jan 11, 2022
2 parents 3629ca3 + eb5ae6b commit d5f49a9
Show file tree
Hide file tree
Showing 267 changed files with 25,166 additions and 16,938 deletions.
29 changes: 28 additions & 1 deletion .github/workflows/deploy_release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,34 @@ jobs:
pushd nebula-docker-compose/
cp ../../client/src/test/resources/docker-compose.yaml .
docker-compose up -d
sleep 10
sleep 30
docker-compose ps
popd
popd
- name: Install nebula-graph with CA SSL
run: |
pushd tmp
mkdir ca
pushd ca
cp -r ../../client/src/test/resources/ssl .
cp ../../client/src/test/resources/docker-compose-casigned.yaml .
docker-compose -f docker-compose-casigned.yaml up -d
sleep 30
docker-compose -f docker-compose-casigned.yaml ps
popd
popd
- name: Install nebula-graph with Self SSL
run: |
pushd tmp
mkdir self
pushd self
cp -r ../../client/src/test/resources/ssl .
cp ../../client/src/test/resources/docker-compose-selfsigned.yaml .
docker-compose -f docker-compose-selfsigned.yaml up -d
sleep 30
docker-compose -f docker-compose-selfsigned.yaml ps
popd
popd
Expand Down
30 changes: 29 additions & 1 deletion .github/workflows/deploy_snapshot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,37 @@ jobs:
pushd nebula-docker-compose/
cp ../../client/src/test/resources/docker-compose.yaml .
docker-compose up -d
sleep 10
sleep 30
docker-compose ps
popd
popd
- name: Install nebula-graph with CA SSL
run: |
pushd tmp
mkdir ca
pushd ca
cp -r ../../client/src/test/resources/ssl .
cp ../../client/src/test/resources/docker-compose-casigned.yaml .
docker-compose -f docker-compose-casigned.yaml up -d
sleep 30
docker-compose -f docker-compose-casigned.yaml ps
popd
popd
- name: Install nebula-graph with Self SSL
run: |
pushd tmp
mkdir self
pushd self
cp -r ../../client/src/test/resources/ssl .
cp ../../client/src/test/resources/docker-compose-selfsigned.yaml .
docker-compose -f docker-compose-selfsigned.yaml up -d
sleep 30
docker-compose -f docker-compose-selfsigned.yaml ps
popd
popd
- name: Deploy Snapshot to Maven package
uses: samuelmeuli/action-maven-publish@v1
with:
Expand Down
31 changes: 29 additions & 2 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,38 @@ jobs:
pushd nebula-docker-compose/
cp ../../client/src/test/resources/docker-compose.yaml .
docker-compose up -d
sleep 10
sleep 30
docker-compose ps
popd
popd
- name: Install nebula-graph with CA SSL
run: |
pushd tmp
mkdir ca
pushd ca
cp -r ../../client/src/test/resources/ssl .
cp ../../client/src/test/resources/docker-compose-casigned.yaml .
docker-compose -f docker-compose-casigned.yaml up -d
sleep 30
docker-compose -f docker-compose-casigned.yaml ps
popd
popd
- name: Install nebula-graph with Self SSL
run: |
pushd tmp
mkdir self
pushd self
cp -r ../../client/src/test/resources/ssl .
cp ../../client/src/test/resources/docker-compose-selfsigned.yaml .
docker-compose -f docker-compose-selfsigned.yaml up -d
sleep 30
docker-compose -f docker-compose-selfsigned.yaml ps
popd
popd
- name: Build with Maven
run: |
mvn -B package
bash <(curl -s https://codecov.io/bash)
- uses: codecov/codecov-action@v2
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,14 @@ target/
.idea/
.eclipse/
*.iml
.vscode/
.settings
.project
client/.classpath

spark-importer.ipr
spark-importer.iws

.DS_Store

examples/
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Copyright (c) 2019 vesoft inc. All rights reserved.
#
# This source code is licensed under Apache 2.0 License,
# attached with Common Clause Condition 1.0, found in the LICENSES directory.
# This source code is licensed under Apache 2.0 License.

language: java

Expand Down
14 changes: 0 additions & 14 deletions LICENSES/CC-1.0.txt

This file was deleted.

17 changes: 10 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,19 @@ The v2.0.0-rc branch works with Nebula Graph v2.0.0-beta and v2.0.0-rc1, but not
To use this Java client, do a check of these:

- Java 8 or a later version is installed.
- Nebula Graph v2.0 is deployed. For more information, see [Deployment and installation of Nebula Graph](https://docs.nebula-graph.io/2.0/4.deployment-and-installation/1.resource-preparations/ "Click to go to Nebula Graph website").
- Nebula Graph is deployed. For more information, see [Deployment and installation of Nebula Graph](https://docs.nebula-graph.io/master/4.deployment-and-installation/1.resource-preparations/ "Click to go to Nebula Graph website").

## Modify pom.xml

If you use Maven to manage your project, add the following dependency to your `pom.xml` file.
Replace `2.0.0-SNAPSHOT` with an appropriate Nebula Java v2.x version.
Replace `3.0-SNAPSHOT` with an appropriate Nebula Java version.
For more versions, visit [releases](https://github.com/vesoft-inc/nebula-java/releases).

```xml
<dependency>
<groupId>com.vesoft</groupId>
<artifactId>client</artifactId>
<version>2.0.0-SNAPSHOT</version>
<version>3.0-SNAPSHOT</version>
</dependency>
```
There are the version correspondence between client and Nebula:
Expand All @@ -62,13 +62,16 @@ There are the version correspondence between client and Nebula:
| 1.2.0 | 1.1.0,1.2.0,1.2.1 |
| 2.0.0-beta | 2.0.0-beta |
| 2.0.0-rc1 | 2.0.0-rc1 |
| 2.0.0/2.0.1 | 2.0.0/2.0.1 |
| 2.5.0 | >= 2.5.0 |
| 2.0.0-SNAPSHOT| 2.0.0-nightly |
| 2.0.0 | 2.0.0,2.0.1 |
| 2.0.1 | 2.0.0,2.0.1 |
| 2.5.0 | 2.5.0,2.5.1 |
| 2.6.0 | 2.6.0,2.6.1 |
| 2.6.1 | 2.6.0,2.6.1 |
| 3.0-SNAPSHOT | nightly |

## Graph client example

To connect to the `nebula-graphd` process of Nebula Graph v2.0:
To connect to the `nebula-graphd` process of Nebula Graph:

```java
NebulaPoolConfig nebulaPoolConfig = new NebulaPoolConfig();
Expand Down
24 changes: 23 additions & 1 deletion client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.vesoft</groupId>
<artifactId>nebula</artifactId>
<version>2.0.0-SNAPSHOT</version>
<version>3.0-SNAPSHOT</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand All @@ -22,6 +22,7 @@
<commons-pool2.version>2.2</commons-pool2.version>
<servlet.version>3.0.1</servlet.version>
<fastjson.version>1.2.78</fastjson.version>
<bouncycastle.version>1.69</bouncycastle.version>
</properties>

<build>
Expand All @@ -37,6 +38,17 @@
</execution>
</executions>
</plugin>
<!-- Nexus Staging Plugin -->
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
Expand Down Expand Up @@ -239,5 +251,15 @@
<artifactId>fastjson</artifactId>
<version>${fastjson.version}</version>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcpkix-jdk15on</artifactId>
<version>${bouncycastle.version}</version>
</dependency>
<dependency>
<groupId>org.locationtech.jts</groupId>
<artifactId>jts-core</artifactId>
<version>1.16.1</version>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,37 @@ public TSocket(Socket socket) throws TTransportException {
}
}

/**
* Constructor that takes an already created socket that comes alone with timeout
* and connectionTimeout.
*
* @param socket Already created socket object
* @param timeout Socket timeout
* @param connectionTimeout Socket connection timeout
* @throws TTransportException if there is an error setting up the streams
*/
public TSocket(Socket socket, int timeout, int connectionTimeout) throws TTransportException {
socket_ = socket;
try {
socket_.setSoLinger(false, 0);
socket_.setTcpNoDelay(true);
socket_.setSoTimeout(timeout);
connectionTimeout_ = connectionTimeout;
} catch (SocketException sx) {
LOGGER.warn("Could not configure socket.", sx);
}

if (isOpen()) {
try {
inputStream_ = new BufferedInputStream(socket_.getInputStream());
outputStream_ = new BufferedOutputStream(socket_.getOutputStream());
} catch (IOException iox) {
close();
throw new TTransportException(TTransportException.NOT_OPEN, iox);
}
}
}

/**
* Creates a new unconnected socket that will connect to the given host on the given port.
*
Expand Down
Loading

0 comments on commit d5f49a9

Please sign in to comment.