Skip to content

Commit

Permalink
update the code style
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicole00 committed Dec 27, 2023
1 parent bd67f0b commit 761100b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,17 @@

package org.apache.flink.connector.nebula.connection;


import com.vesoft.nebula.client.graph.NebulaPoolConfig;
import com.vesoft.nebula.client.graph.data.CASignedSSLParam;
import com.vesoft.nebula.client.graph.data.HostAddress;
import com.vesoft.nebula.client.graph.data.SSLParam;
import com.vesoft.nebula.client.graph.data.SelfSignedSSLParam;
import com.vesoft.nebula.client.graph.net.NebulaPool;

import java.io.Serializable;
import java.net.UnknownHostException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

import org.apache.flink.connector.nebula.utils.NebulaConstant;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand All @@ -45,7 +42,6 @@ public NebulaPool getNebulaPool() throws UnknownHostException {
}

Collections.shuffle(addresses);
NebulaPool nebulaPool = new NebulaPool();
NebulaPoolConfig poolConfig = new NebulaPoolConfig();
poolConfig.setTimeout(nebulaClientOptions.getTimeout());
poolConfig.setVersion(nebulaClientOptions.getVersion());
Expand All @@ -70,6 +66,7 @@ public NebulaPool getNebulaPool() throws UnknownHostException {
throw new IllegalArgumentException("ssl sign type is not supported.");
}
}
NebulaPool nebulaPool = new NebulaPool();
if (nebulaPool.init(addresses, poolConfig)) {
return nebulaPool;
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@
import com.vesoft.nebula.client.graph.exception.IOErrorException;
import com.vesoft.nebula.client.graph.exception.NotValidConnectionException;
import com.vesoft.nebula.client.graph.net.NebulaPool;

import java.net.UnknownHostException;

import org.apache.flink.connector.nebula.utils.SSLSignType;
import org.junit.After;
import org.junit.Before;
Expand Down Expand Up @@ -74,7 +72,8 @@ public void getNebulaPoolWithWrongVersion() {
nebulaPool.getSession("root", "nebula", true);
} catch (Exception e) {
LOG.info("get session failed", e);
if (e.getMessage().contains("Current client is not compatible with the remote server")) {
if (e.getMessage()
.contains("Current client is not compatible with the remote server")) {
assert true;
} else {
assert false;
Expand Down

0 comments on commit 761100b

Please sign in to comment.