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

Upgrade guava #86

Merged
merged 1 commit into from
Apr 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 20 additions & 9 deletions client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,23 @@
<parent>
<groupId>com.vesoft</groupId>
<artifactId>nebula</artifactId>
<version>1.0.0-rc4.20200323</version>
<version>1.0.0-rc4.20200422</version>
</parent>

<modelVersion>4.0.0</modelVersion>
<artifactId>client</artifactId>

<properties>
<commons-lang.version>2.6</commons-lang.version>
<commons-lang3.version>3.8</commons-lang3.version>
<slf4j-log4j12.version>1.7.25</slf4j-log4j12.version>
<slf4j-api.version>1.7.25</slf4j-api.version>
<junit.version>4.12</junit.version>
<guava.version>29.0-jre</guava.version>
<commons-codec.version>1.13</commons-codec.version>
<nebula-utils.version>1.0.0-rc2</nebula-utils.version>
</properties>

<build>
<plugins>
<plugin>
Expand Down Expand Up @@ -173,43 +184,43 @@
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>2.6</version>
<version>${commons-lang.version}</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.8</version>
<version>${commons-lang3.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.7.25</version>
<version>${slf4j-log4j12.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.25</version>
<version>${slf4j-api.version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>14.0</version>
<version>${guava.version}</version>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.13</version>
<version>${commons-codec.version}</version>
</dependency>
<dependency>
<groupId>com.vesoft</groupId>
<artifactId>nebula-utils</artifactId>
<version>1.0.0-rc2</version>
<version>${nebula-utils.version}</version>
</dependency>
</dependencies>
</project>
2 changes: 1 addition & 1 deletion client/src/main/java/com/vesoft/nebula/AbstractClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public AbstractClient(List<HostAndPort> addresses, int timeout,
checkArgument(connectionRetry > 0);
checkArgument(executionRetry > 0);
for (HostAndPort address : addresses) {
String host = address.getHostText();
String host = address.getHost();
int port = address.getPort();
if (!InetAddresses.isInetAddress(host) || (port <= 0 || port >= 65535)) {
throw new IllegalArgumentException(String.format("%s:%d is not a valid address",
Expand Down
2 changes: 1 addition & 1 deletion client/src/main/java/com/vesoft/nebula/Cluster.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public Builder() {
*/
public Cluster.Builder addNode(String host, int port) {
for (HostAndPort address : addresses) {
if (address.getHostText().equals(host) && address.getPort() == port) {
if (address.getHost().equals(host) && address.getPort() == port) {
throw new IllegalArgumentException("Address have duplicate");
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public int doConnect(List<HostAndPort> addresses) throws TException {
Random random = new Random(System.currentTimeMillis());
int position = random.nextInt(addresses.size());
HostAndPort address = addresses.get(position);
transport = new TSocket(address.getHostText(), address.getPort(), timeout);
transport = new TSocket(address.getHost(), address.getPort(), timeout);
transport.open();
protocol = new TCompactProtocol(transport);
client = new GraphService.Client(protocol);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import com.google.common.base.Optional;
import com.google.common.net.HostAndPort;
import com.google.common.util.concurrent.ListenableFuture;
import com.vesoft.nebula.AsyncAbstractClient;
import com.vesoft.nebula.client.graph.NGQLException;
import com.vesoft.nebula.client.graph.ResultSet;
import com.vesoft.nebula.client.graph.async.entry.AuthenticateCallback;
Expand Down Expand Up @@ -72,7 +71,7 @@ public int doConnect(List<HostAndPort> addresses) throws TException {

try {
manager = new TAsyncClientManager();
transport = new TNonblockingSocket(address.getHostText(),
transport = new TNonblockingSocket(address.getHost(),
address.getPort(), timeout);
TProtocolFactory protocol = new TBinaryProtocol.Factory();
client = new GraphService.AsyncClient(protocol, manager, transport);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
import com.vesoft.nebula.meta.TagItem;
import com.vesoft.nebula.utils.AddressUtil;
import com.vesoft.nebula.utils.NebulaTypeUtil;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
Expand Down Expand Up @@ -81,7 +80,7 @@ public int doConnect(List<HostAndPort> addresses) throws TException {
Random random = new Random(System.currentTimeMillis());
int position = random.nextInt(addresses.size());
HostAndPort address = addresses.get(position);
transport = new TSocket(address.getHostText(), address.getPort(), timeout);
transport = new TSocket(address.getHost(), address.getPort(), timeout);
transport.open();
protocol = new TCompactProtocol(transport);
client = new MetaService.Client(protocol);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public int doConnect(List<HostAndPort> addresses) throws TException {
}

private StorageService.Client doConnect(HostAndPort address) throws TException {
TTransport transport = new TSocket(address.getHostText(), address.getPort(), timeout);
TTransport transport = new TSocket(address.getHost(), address.getPort(), timeout);
transport.open();

TProtocol protocol = new TCompactProtocol(transport);
Expand Down
2 changes: 1 addition & 1 deletion examples/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>1.0.0-rc4.20200323</version>
<version>1.0.0-rc4.20200422</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<groupId>com.vesoft</groupId>
<artifactId>nebula</artifactId>
<packaging>pom</packaging>
<version>1.0.0-rc4.20200323</version>
<version>1.0.0-rc4.20200422</version>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down