diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 181a128..5ac7745 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,7 +10,7 @@ on: jobs: build: - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 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 4f189bb..797cd4d 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 @@ -40,14 +40,14 @@ public class NebulaClientOptions implements Serializable { private final SelfSignParams selfSignParams; - private final String version; + private final String handshakeKey; private NebulaClientOptions(String metaAddress, String graphAddress, String username, String password, int timeout, int connectRetry, boolean enableGraphSSL, boolean enableMetaSSL, boolean enableStorageSSL, SSLSignType sslSignType, CASignParams caSignParams, - SelfSignParams selfSignParams, String version) { + SelfSignParams selfSignParams, String handshakeKey) { this.metaAddress = metaAddress; this.graphAddress = graphAddress; this.username = username; @@ -60,7 +60,7 @@ private NebulaClientOptions(String metaAddress, String graphAddress, String user this.sslSignType = sslSignType; this.caSignParams = caSignParams; this.selfSignParams = selfSignParams; - this.version = version; + this.handshakeKey = handshakeKey; } public List getMetaAddress() { @@ -120,8 +120,8 @@ public SelfSignParams getSelfSignParam() { return selfSignParams; } - public String getVersion() { - return version; + public String getHandshakeKey() { + return handshakeKey; } /** @@ -142,7 +142,7 @@ public static class NebulaClientOptionsBuilder { private SSLSignType sslSignType = null; private CASignParams caSignParams = null; private SelfSignParams selfSignParams = null; - private String version = null; + private String handshakeKey = null; public NebulaClientOptionsBuilder setMetaAddress(String metaAddress) { this.metaAddress = metaAddress; @@ -207,8 +207,8 @@ public NebulaClientOptionsBuilder setSelfSignParam(String crtFilePath, String ke return this; } - public NebulaClientOptionsBuilder setVersion(String version) { - this.version = version; + public NebulaClientOptionsBuilder setHandshakeKey(String handshakeKey) { + this.handshakeKey = handshakeKey; return this; } @@ -259,7 +259,7 @@ public NebulaClientOptions build() { sslSignType, caSignParams, selfSignParams, - version); + handshakeKey); } } } 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 15244da..e7f54b4 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 @@ -44,7 +44,7 @@ public NebulaPool getNebulaPool() throws UnknownHostException { Collections.shuffle(addresses); NebulaPoolConfig poolConfig = new NebulaPoolConfig(); poolConfig.setTimeout(nebulaClientOptions.getTimeout()); - poolConfig.setVersion(nebulaClientOptions.getVersion()); + poolConfig.setHandshakeKey(nebulaClientOptions.getHandshakeKey()); if (nebulaClientOptions.isEnableGraphSSL()) { poolConfig.setEnableSsl(true); switch (nebulaClientOptions.getSSLSignType()) { 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 502aa53..55921fb 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 @@ -65,7 +65,7 @@ public MetaClient getMetaClient() throws TException, ClientServerIncompatibleExc metaClient = new MetaClient(addresses, timeout, retry, retry); } - metaClient.setVersion(nebulaClientOptions.getVersion()); + metaClient.setHandshakeKey(nebulaClientOptions.getHandshakeKey()); metaClient.connect(); return metaClient; } 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 aa82568..0337ea8 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 @@ -56,7 +56,7 @@ public StorageClient getStorageClient() throws Exception { storageClient = new StorageClient(addresses, timeout); } - storageClient.setVersion(nebulaClientOptions.getVersion()); + storageClient.setHandshakeKey(nebulaClientOptions.getHandshakeKey()); if (!storageClient.connect()) { throw new Exception("failed to connect storaged."); } 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 84b5062..481c9e0 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 @@ -40,7 +40,7 @@ public void getNebulaPool() { .setPassword("nebula") .setConnectRetry(1) .setTimeout(1000) - .setVersion("test") + .setHandshakeKey("test") .build(); NebulaGraphConnectionProvider graphConnectionProvider = new NebulaGraphConnectionProvider(nebulaClientOptions); @@ -63,7 +63,7 @@ public void getNebulaPoolWithWrongVersion() { .setPassword("nebula") .setConnectRetry(1) .setTimeout(1000) - .setVersion("INVALID_VERSION") + .setHandshakeKey("INVALID_VERSION") .build(); NebulaGraphConnectionProvider graphConnectionProvider = new NebulaGraphConnectionProvider(nebulaClientOptions);