From 761100b470fdaa695dc372a1053b366d471f620b Mon Sep 17 00:00:00 2001 From: Anqi Date: Wed, 27 Dec 2023 11:38:03 +0800 Subject: [PATCH] update the code style --- .../nebula/connection/NebulaGraphConnectionProvider.java | 5 +---- .../nebula/connection/NebulaGraphConnectionProviderTest.java | 5 ++--- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/connector/src/main/java/org.apache.flink/connector/nebula/connection/NebulaGraphConnectionProvider.java b/connector/src/main/java/org.apache.flink/connector/nebula/connection/NebulaGraphConnectionProvider.java index 18dcd7e..15244da 100644 --- a/connector/src/main/java/org.apache.flink/connector/nebula/connection/NebulaGraphConnectionProvider.java +++ b/connector/src/main/java/org.apache.flink/connector/nebula/connection/NebulaGraphConnectionProvider.java @@ -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; @@ -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()); @@ -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 { diff --git a/connector/src/test/java/org/apache/flink/connector/nebula/connection/NebulaGraphConnectionProviderTest.java b/connector/src/test/java/org/apache/flink/connector/nebula/connection/NebulaGraphConnectionProviderTest.java index a71598a..99704a3 100644 --- a/connector/src/test/java/org/apache/flink/connector/nebula/connection/NebulaGraphConnectionProviderTest.java +++ b/connector/src/test/java/org/apache/flink/connector/nebula/connection/NebulaGraphConnectionProviderTest.java @@ -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; @@ -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;