Skip to content

Commit d5f49a9

Browse files
authored
Merge branch 'master' into master
2 parents 3629ca3 + eb5ae6b commit d5f49a9

File tree

267 files changed

+25166
-16938
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

267 files changed

+25166
-16938
lines changed

.github/workflows/deploy_release.yaml

+28-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,34 @@ jobs:
2525
pushd nebula-docker-compose/
2626
cp ../../client/src/test/resources/docker-compose.yaml .
2727
docker-compose up -d
28-
sleep 10
28+
sleep 30
29+
docker-compose ps
30+
popd
31+
popd
32+
33+
- name: Install nebula-graph with CA SSL
34+
run: |
35+
pushd tmp
36+
mkdir ca
37+
pushd ca
38+
cp -r ../../client/src/test/resources/ssl .
39+
cp ../../client/src/test/resources/docker-compose-casigned.yaml .
40+
docker-compose -f docker-compose-casigned.yaml up -d
41+
sleep 30
42+
docker-compose -f docker-compose-casigned.yaml ps
43+
popd
44+
popd
45+
46+
- name: Install nebula-graph with Self SSL
47+
run: |
48+
pushd tmp
49+
mkdir self
50+
pushd self
51+
cp -r ../../client/src/test/resources/ssl .
52+
cp ../../client/src/test/resources/docker-compose-selfsigned.yaml .
53+
docker-compose -f docker-compose-selfsigned.yaml up -d
54+
sleep 30
55+
docker-compose -f docker-compose-selfsigned.yaml ps
2956
popd
3057
popd
3158

.github/workflows/deploy_snapshot.yaml

+29-1
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,37 @@ jobs:
2626
pushd nebula-docker-compose/
2727
cp ../../client/src/test/resources/docker-compose.yaml .
2828
docker-compose up -d
29-
sleep 10
29+
sleep 30
30+
docker-compose ps
3031
popd
3132
popd
33+
34+
- name: Install nebula-graph with CA SSL
35+
run: |
36+
pushd tmp
37+
mkdir ca
38+
pushd ca
39+
cp -r ../../client/src/test/resources/ssl .
40+
cp ../../client/src/test/resources/docker-compose-casigned.yaml .
41+
docker-compose -f docker-compose-casigned.yaml up -d
42+
sleep 30
43+
docker-compose -f docker-compose-casigned.yaml ps
44+
popd
45+
popd
46+
47+
- name: Install nebula-graph with Self SSL
48+
run: |
49+
pushd tmp
50+
mkdir self
51+
pushd self
52+
cp -r ../../client/src/test/resources/ssl .
53+
cp ../../client/src/test/resources/docker-compose-selfsigned.yaml .
54+
docker-compose -f docker-compose-selfsigned.yaml up -d
55+
sleep 30
56+
docker-compose -f docker-compose-selfsigned.yaml ps
57+
popd
58+
popd
59+
3260
- name: Deploy Snapshot to Maven package
3361
uses: samuelmeuli/action-maven-publish@v1
3462
with:

.github/workflows/maven.yml

+29-2
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,38 @@ jobs:
4040
pushd nebula-docker-compose/
4141
cp ../../client/src/test/resources/docker-compose.yaml .
4242
docker-compose up -d
43-
sleep 10
43+
sleep 30
44+
docker-compose ps
45+
popd
46+
popd
47+
48+
- name: Install nebula-graph with CA SSL
49+
run: |
50+
pushd tmp
51+
mkdir ca
52+
pushd ca
53+
cp -r ../../client/src/test/resources/ssl .
54+
cp ../../client/src/test/resources/docker-compose-casigned.yaml .
55+
docker-compose -f docker-compose-casigned.yaml up -d
56+
sleep 30
57+
docker-compose -f docker-compose-casigned.yaml ps
58+
popd
59+
popd
60+
61+
- name: Install nebula-graph with Self SSL
62+
run: |
63+
pushd tmp
64+
mkdir self
65+
pushd self
66+
cp -r ../../client/src/test/resources/ssl .
67+
cp ../../client/src/test/resources/docker-compose-selfsigned.yaml .
68+
docker-compose -f docker-compose-selfsigned.yaml up -d
69+
sleep 30
70+
docker-compose -f docker-compose-selfsigned.yaml ps
4471
popd
4572
popd
4673
4774
- name: Build with Maven
4875
run: |
4976
mvn -B package
50-
bash <(curl -s https://codecov.io/bash)
77+
- uses: codecov/codecov-action@v2

.gitignore

+6
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,14 @@ target/
2929
.idea/
3030
.eclipse/
3131
*.iml
32+
.vscode/
33+
.settings
34+
.project
35+
client/.classpath
3236

3337
spark-importer.ipr
3438
spark-importer.iws
3539

3640
.DS_Store
41+
42+
examples/

.travis.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# Copyright (c) 2019 vesoft inc. All rights reserved.
22
#
3-
# This source code is licensed under Apache 2.0 License,
4-
# attached with Common Clause Condition 1.0, found in the LICENSES directory.
3+
# This source code is licensed under Apache 2.0 License.
54

65
language: java
76

LICENSES/CC-1.0.txt

-14
This file was deleted.

README.md

+10-7
Original file line numberDiff line numberDiff line change
@@ -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
3737
To use this Java client, do a check of these:
3838

3939
- Java 8 or a later version is installed.
40-
- 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").
40+
- 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").
4141

4242
## Modify pom.xml
4343

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

4848
```xml
4949
<dependency>
5050
<groupId>com.vesoft</groupId>
5151
<artifactId>client</artifactId>
52-
<version>2.0.0-SNAPSHOT</version>
52+
<version>3.0-SNAPSHOT</version>
5353
</dependency>
5454
```
5555
There are the version correspondence between client and Nebula:
@@ -62,13 +62,16 @@ There are the version correspondence between client and Nebula:
6262
| 1.2.0 | 1.1.0,1.2.0,1.2.1 |
6363
| 2.0.0-beta | 2.0.0-beta |
6464
| 2.0.0-rc1 | 2.0.0-rc1 |
65-
| 2.0.0/2.0.1 | 2.0.0/2.0.1 |
66-
| 2.5.0 | >= 2.5.0 |
67-
| 2.0.0-SNAPSHOT| 2.0.0-nightly |
65+
| 2.0.0 | 2.0.0,2.0.1 |
66+
| 2.0.1 | 2.0.0,2.0.1 |
67+
| 2.5.0 | 2.5.0,2.5.1 |
68+
| 2.6.0 | 2.6.0,2.6.1 |
69+
| 2.6.1 | 2.6.0,2.6.1 |
70+
| 3.0-SNAPSHOT | nightly |
6871

6972
## Graph client example
7073

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

7376
```java
7477
NebulaPoolConfig nebulaPoolConfig = new NebulaPoolConfig();

client/pom.xml

+23-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>com.vesoft</groupId>
77
<artifactId>nebula</artifactId>
8-
<version>2.0.0-SNAPSHOT</version>
8+
<version>3.0-SNAPSHOT</version>
99
</parent>
1010

1111
<modelVersion>4.0.0</modelVersion>
@@ -22,6 +22,7 @@
2222
<commons-pool2.version>2.2</commons-pool2.version>
2323
<servlet.version>3.0.1</servlet.version>
2424
<fastjson.version>1.2.78</fastjson.version>
25+
<bouncycastle.version>1.69</bouncycastle.version>
2526
</properties>
2627

2728
<build>
@@ -37,6 +38,17 @@
3738
</execution>
3839
</executions>
3940
</plugin>
41+
<!-- Nexus Staging Plugin -->
42+
<plugin>
43+
<groupId>org.sonatype.plugins</groupId>
44+
<artifactId>nexus-staging-maven-plugin</artifactId>
45+
<extensions>true</extensions>
46+
<configuration>
47+
<serverId>ossrh</serverId>
48+
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
49+
<autoReleaseAfterClose>true</autoReleaseAfterClose>
50+
</configuration>
51+
</plugin>
4052
<plugin>
4153
<groupId>org.codehaus.mojo</groupId>
4254
<artifactId>build-helper-maven-plugin</artifactId>
@@ -239,5 +251,15 @@
239251
<artifactId>fastjson</artifactId>
240252
<version>${fastjson.version}</version>
241253
</dependency>
254+
<dependency>
255+
<groupId>org.bouncycastle</groupId>
256+
<artifactId>bcpkix-jdk15on</artifactId>
257+
<version>${bouncycastle.version}</version>
258+
</dependency>
259+
<dependency>
260+
<groupId>org.locationtech.jts</groupId>
261+
<artifactId>jts-core</artifactId>
262+
<version>1.16.1</version>
263+
</dependency>
242264
</dependencies>
243265
</project>

client/src/main/fbthrift/com/facebook/thrift/transport/TSocket.java

+31
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,37 @@ public TSocket(Socket socket) throws TTransportException {
7070
}
7171
}
7272

73+
/**
74+
* Constructor that takes an already created socket that comes alone with timeout
75+
* and connectionTimeout.
76+
*
77+
* @param socket Already created socket object
78+
* @param timeout Socket timeout
79+
* @param connectionTimeout Socket connection timeout
80+
* @throws TTransportException if there is an error setting up the streams
81+
*/
82+
public TSocket(Socket socket, int timeout, int connectionTimeout) throws TTransportException {
83+
socket_ = socket;
84+
try {
85+
socket_.setSoLinger(false, 0);
86+
socket_.setTcpNoDelay(true);
87+
socket_.setSoTimeout(timeout);
88+
connectionTimeout_ = connectionTimeout;
89+
} catch (SocketException sx) {
90+
LOGGER.warn("Could not configure socket.", sx);
91+
}
92+
93+
if (isOpen()) {
94+
try {
95+
inputStream_ = new BufferedInputStream(socket_.getInputStream());
96+
outputStream_ = new BufferedOutputStream(socket_.getOutputStream());
97+
} catch (IOException iox) {
98+
close();
99+
throw new TTransportException(TTransportException.NOT_OPEN, iox);
100+
}
101+
}
102+
}
103+
73104
/**
74105
* Creates a new unconnected socket that will connect to the given host on the given port.
75106
*

0 commit comments

Comments
 (0)