diff --git a/connector/src/main/java/org.apache.flink/connector/nebula/connection/NebulaClientOptions.java b/connector/src/main/java/org.apache.flink/connector/nebula/connection/NebulaClientOptions.java index 7f2de1b..b6610b2 100644 --- a/connector/src/main/java/org.apache.flink/connector/nebula/connection/NebulaClientOptions.java +++ b/connector/src/main/java/org.apache.flink/connector/nebula/connection/NebulaClientOptions.java @@ -10,7 +10,7 @@ import java.util.ArrayList; import java.util.List; import org.apache.flink.connector.nebula.utils.NebulaConstant; -import org.apache.flink.connector.nebula.utils.SSLSighType; +import org.apache.flink.connector.nebula.utils.SSLSignType; public class NebulaClientOptions implements Serializable { @@ -34,7 +34,7 @@ public class NebulaClientOptions implements Serializable { private final boolean enableStorageSSL; - private final SSLSighType sslSighType; + private final SSLSignType sslSignType; private final CASignParams caSignParams; @@ -45,7 +45,7 @@ private NebulaClientOptions(String metaAddress, String graphAddress, String user String password, int timeout, int connectRetry, boolean enableGraphSSL, boolean enableMetaSSL, boolean enableStorageSSL, - SSLSighType sslSighType, CASignParams caSignParams, + SSLSignType sslSignType, CASignParams caSignParams, SelfSignParams selfSignParams) { this.metaAddress = metaAddress; this.graphAddress = graphAddress; @@ -56,7 +56,7 @@ private NebulaClientOptions(String metaAddress, String graphAddress, String user this.enableGraphSSL = enableGraphSSL; this.enableMetaSSL = enableMetaSSL; this.enableStorageSSL = enableStorageSSL; - this.sslSighType = sslSighType; + this.sslSignType = sslSignType; this.caSignParams = caSignParams; this.selfSignParams = selfSignParams; } @@ -106,8 +106,8 @@ public boolean isEnableStorageSSL() { return enableStorageSSL; } - public SSLSighType getSSLSighType() { - return sslSighType; + public SSLSignType getSSLSignType() { + return sslSignType; } public CASignParams getCaSignParam() { @@ -133,7 +133,7 @@ public static class NebulaClientOptionsBuilder { private boolean enableGraphSSL = false; private boolean enableMetaSSL = false; private boolean enableStorageSSL = false; - private SSLSighType sslSighType = null; + private SSLSignType sslSignType = null; private CASignParams caSignParams = null; private SelfSignParams selfSignParams = null; @@ -183,8 +183,8 @@ public NebulaClientOptionsBuilder setEnableStorageSSL(boolean enableStorageSSL) } - public NebulaClientOptionsBuilder setSSLSignType(SSLSighType sslSighType) { - this.sslSighType = sslSighType; + public NebulaClientOptionsBuilder setSSLSignType(SSLSignType sslSignType) { + this.sslSignType = sslSignType; return this; } @@ -211,11 +211,11 @@ public NebulaClientOptions build() { "storage ssl is enabled, meta ssl must be enabled."); } - if (sslSighType == null) { + if (sslSignType == null) { throw new IllegalArgumentException("ssl is enabled, ssl sign type must not be " + "null"); } - switch (sslSighType) { + switch (sslSignType) { case CA: if (caSignParams == null) { throw new IllegalArgumentException("ssl is enabled and sign type is " @@ -244,7 +244,7 @@ public NebulaClientOptions build() { enableGraphSSL, enableMetaSSL, enableStorageSSL, - sslSighType, + sslSignType, caSignParams, selfSignParams); } 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 af9b99c..f05d102 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 @@ -48,7 +48,7 @@ public NebulaPool getNebulaPool() throws UnknownHostException { poolConfig.setTimeout(nebulaClientOptions.getTimeout()); if (nebulaClientOptions.isEnableGraphSSL()) { poolConfig.setEnableSsl(true); - switch (nebulaClientOptions.getSSLSighType()) { + switch (nebulaClientOptions.getSSLSignType()) { case CA: { CASignParams caSignParams = nebulaClientOptions.getCaSignParam(); SSLParam sslParam = new CASignedSSLParam(caSignParams.getCaCrtFilePath(), diff --git a/connector/src/main/java/org.apache.flink/connector/nebula/connection/NebulaMetaConnectionProvider.java b/connector/src/main/java/org.apache.flink/connector/nebula/connection/NebulaMetaConnectionProvider.java index 08c7985..8347e90 100644 --- a/connector/src/main/java/org.apache.flink/connector/nebula/connection/NebulaMetaConnectionProvider.java +++ b/connector/src/main/java/org.apache.flink/connector/nebula/connection/NebulaMetaConnectionProvider.java @@ -43,7 +43,7 @@ public MetaClient getMetaClient() throws TException, ClientServerIncompatibleExc int retry = nebulaClientOptions.getConnectRetry(); MetaClient metaClient; if (nebulaClientOptions.isEnableMetaSSL()) { - switch (nebulaClientOptions.getSSLSighType()) { + switch (nebulaClientOptions.getSSLSignType()) { case CA: { CASignParams caSignParams = nebulaClientOptions.getCaSignParam(); SSLParam sslParam = new CASignedSSLParam(caSignParams.getCaCrtFilePath(), diff --git a/connector/src/main/java/org.apache.flink/connector/nebula/connection/NebulaStorageConnectionProvider.java b/connector/src/main/java/org.apache.flink/connector/nebula/connection/NebulaStorageConnectionProvider.java index 84b00cb..3273693 100644 --- a/connector/src/main/java/org.apache.flink/connector/nebula/connection/NebulaStorageConnectionProvider.java +++ b/connector/src/main/java/org.apache.flink/connector/nebula/connection/NebulaStorageConnectionProvider.java @@ -32,7 +32,7 @@ public StorageClient getStorageClient() throws Exception { int retry = nebulaClientOptions.getConnectRetry(); StorageClient storageClient; if (nebulaClientOptions.isEnableStorageSSL()) { - switch (nebulaClientOptions.getSSLSighType()) { + switch (nebulaClientOptions.getSSLSignType()) { case CA: { CASignParams caSignParams = nebulaClientOptions.getCaSignParam(); SSLParam sslParam = new CASignedSSLParam(caSignParams.getCaCrtFilePath(), diff --git a/connector/src/main/java/org.apache.flink/connector/nebula/utils/SSLSighType.java b/connector/src/main/java/org.apache.flink/connector/nebula/utils/SSLSignType.java similarity index 85% rename from connector/src/main/java/org.apache.flink/connector/nebula/utils/SSLSighType.java rename to connector/src/main/java/org.apache.flink/connector/nebula/utils/SSLSignType.java index 16fd808..51e8af5 100644 --- a/connector/src/main/java/org.apache.flink/connector/nebula/utils/SSLSighType.java +++ b/connector/src/main/java/org.apache.flink/connector/nebula/utils/SSLSignType.java @@ -5,7 +5,7 @@ package org.apache.flink.connector.nebula.utils; -public enum SSLSighType { +public enum SSLSignType { /** * CA sign */ @@ -18,7 +18,7 @@ public enum SSLSighType { private String type; - SSLSighType(String type) { + SSLSignType(String type) { this.type = type; } } diff --git a/connector/src/test/java/org/apache/flink/connector/nebula/connection/NebulaClientOptionsTest.java b/connector/src/test/java/org/apache/flink/connector/nebula/connection/NebulaClientOptionsTest.java index 7780659..b113946 100644 --- a/connector/src/test/java/org/apache/flink/connector/nebula/connection/NebulaClientOptionsTest.java +++ b/connector/src/test/java/org/apache/flink/connector/nebula/connection/NebulaClientOptionsTest.java @@ -6,7 +6,7 @@ package org.apache.flink.connector.nebula.connection; -import org.apache.flink.connector.nebula.utils.SSLSighType; +import org.apache.flink.connector.nebula.utils.SSLSignType; import org.junit.Test; public class NebulaClientOptionsTest { @@ -22,7 +22,7 @@ public void testConfigAddress() { .setTimeout(1000) .setEnableGraphSSL(true) .setEnableMetaSSL(true) - .setSSLSignType(SSLSighType.CA) + .setSSLSignType(SSLSignType.CA) .setCaSignParam("caCrtFile", "crtFile", "keyFile") .setSelfSignParam("crtFile", "keyFile", "password") .build(); @@ -53,14 +53,14 @@ public void testIsEnableGraphSsl() { .setMetaAddress("127.0.0.1:9559") .setEnableMetaSSL(false) .setEnableStorageSSL(true) - .setSSLSignType(SSLSighType.CA) + .setSSLSignType(SSLSignType.CA) .setCaSignParam("caCrtFile", "crtFile", "keyFile") .build(); } @Test(expected = IllegalArgumentException.class) - public void testNullSslSighType() { + public void testNullSslSignType() { NebulaClientOptions nebulaClientOptions = new NebulaClientOptions .NebulaClientOptionsBuilder() .setGraphAddress(null) @@ -73,7 +73,7 @@ public void testNullSslSighType() { } @Test(expected = IllegalArgumentException.class) - public void testNoSslSighType() { + public void testNoSslSignType() { NebulaClientOptions nebulaClientOptions = new NebulaClientOptions .NebulaClientOptionsBuilder() .setGraphAddress(null) @@ -92,7 +92,7 @@ public void testGetCaSignParam() { .setMetaAddress("127.0.0.1:9559") .setEnableGraphSSL(false) .setEnableMetaSSL(true) - .setSSLSignType(SSLSighType.CA) + .setSSLSignType(SSLSignType.CA) .setSelfSignParam("crtFile", "keyFile", "password") .build(); @@ -106,7 +106,7 @@ public void testGetSelfSignParam() { .setMetaAddress("127.0.0.1:9559") .setEnableGraphSSL(false) .setEnableMetaSSL(true) - .setSSLSignType(SSLSighType.SELF) + .setSSLSignType(SSLSignType.SELF) .setCaSignParam("caCrtFile", "crtFile", "keyFile") .build(); } 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 c50d41c..ad662aa 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 @@ -11,7 +11,7 @@ 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.SSLSighType; +import org.apache.flink.connector.nebula.utils.SSLSignType; import org.junit.After; import org.junit.Before; import org.junit.Test; @@ -67,7 +67,7 @@ public void getSessionWithSsl() throws NotValidConnectionException { .setTimeout(1000) .setEnableGraphSSL(true) .setEnableMetaSSL(true) - .setSSLSignType(SSLSighType.CA) + .setSSLSignType(SSLSignType.CA) .setCaSignParam("src/test/resources/ssl/casigned.pem", "src/test/resources/ssl/casigned.crt", "src/test/resources/ssl/casigned.key") diff --git a/example/src/main/java/org/apache/flink/FlinkConnectorSinkExample.java b/example/src/main/java/org/apache/flink/FlinkConnectorSinkExample.java index a41d23f..df96de9 100644 --- a/example/src/main/java/org/apache/flink/FlinkConnectorSinkExample.java +++ b/example/src/main/java/org/apache/flink/FlinkConnectorSinkExample.java @@ -16,7 +16,7 @@ import org.apache.flink.connector.nebula.sink.NebulaVertexBatchOutputFormat; import org.apache.flink.connector.nebula.statement.EdgeExecutionOptions; import org.apache.flink.connector.nebula.statement.VertexExecutionOptions; -import org.apache.flink.connector.nebula.utils.SSLSighType; +import org.apache.flink.connector.nebula.utils.SSLSignType; import org.apache.flink.connector.nebula.utils.WriteModeEnum; import org.apache.flink.streaming.api.datastream.DataStream; import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment; @@ -113,7 +113,7 @@ private static NebulaClientOptions getClientOptions() { .setGraphAddress("127.0.0.1:9669") .setMetaAddress("127.0.0.1:9559") .setEnableGraphSSL(true) - .setSSLSignType(SSLSighType.CA) + .setSSLSignType(SSLSignType.CA) .setCaSignParam("example/src/main/resources/ssl/casigned.pem", "example/src/main/resources/ssl/casigned.crt", "example/src/main/resources/ssl/casigned.key") @@ -125,7 +125,7 @@ private static NebulaClientOptions getClientOptions() { .setGraphAddress("127.0.0.1:9669") .setMetaAddress("127.0.0.1:9559") .setEnableGraphSSL(true) - .setSSLSignType(SSLSighType.SELF) + .setSSLSignType(SSLSignType.SELF) .setSelfSignParam("example/src/main/resources/ssl/selfsigned.pem", "example/src/main/resources/ssl/selfsigned.key", "vesoft") diff --git a/example/src/main/java/org/apache/flink/FlinkConnectorSourceExample.java b/example/src/main/java/org/apache/flink/FlinkConnectorSourceExample.java index 60f9fb0..4c6b28e 100644 --- a/example/src/main/java/org/apache/flink/FlinkConnectorSourceExample.java +++ b/example/src/main/java/org/apache/flink/FlinkConnectorSourceExample.java @@ -19,7 +19,7 @@ import org.apache.flink.connector.nebula.statement.EdgeExecutionOptions; import org.apache.flink.connector.nebula.statement.ExecutionOptions; import org.apache.flink.connector.nebula.statement.VertexExecutionOptions; -import org.apache.flink.connector.nebula.utils.SSLSighType; +import org.apache.flink.connector.nebula.utils.SSLSignType; import org.apache.flink.streaming.api.datastream.DataStreamSource; import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment; import org.apache.flink.types.Row; @@ -82,7 +82,7 @@ public static void initConfig() { .setMetaAddress("127.0.0.1:9559") .setEnableMetaSSL(true) .setEnableStorageSSL(true) - .setSSLSignType(SSLSighType.CA) + .setSSLSignType(SSLSignType.CA) .setCaSignParam("example/src/main/resources/ssl/casigned.pem", "example/src/main/resources/ssl/casigned.crt", "example/src/main/resources/ssl/casigned.key") @@ -95,7 +95,7 @@ public static void initConfig() { .setMetaAddress("127.0.0.1:9559") .setEnableMetaSSL(true) .setEnableStorageSSL(true) - .setSSLSignType(SSLSighType.SELF) + .setSSLSignType(SSLSignType.SELF) .setSelfSignParam("example/src/main/resources/ssl/selfsigned.pem", "example/src/main/resources/ssl/selfsigned.key", "vesoft")