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

refactor version to handshakeKey #96

Merged
merged 1 commit into from
Jan 5, 2024
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
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
jobs:
build:

runs-on: ubuntu-18.04
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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<HostAddress> getMetaAddress() {
Expand Down Expand Up @@ -120,8 +120,8 @@ public SelfSignParams getSelfSignParam() {
return selfSignParams;
}

public String getVersion() {
return version;
public String getHandshakeKey() {
return handshakeKey;
}

/**
Expand All @@ -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;
Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -259,7 +259,7 @@ public NebulaClientOptions build() {
sslSignType,
caSignParams,
selfSignParams,
version);
handshakeKey);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public void getNebulaPool() {
.setPassword("nebula")
.setConnectRetry(1)
.setTimeout(1000)
.setVersion("test")
.setHandshakeKey("test")
.build();
NebulaGraphConnectionProvider graphConnectionProvider =
new NebulaGraphConnectionProvider(nebulaClientOptions);
Expand All @@ -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);
Expand Down
Loading