Skip to content

Commit 7daa6e0

Browse files
Merge pull request #1 from griddb/5.3-rc
Update for 5.3
2 parents d1d9a3e + f4dc967 commit 7daa6e0

28 files changed

Lines changed: 4389 additions & 1661 deletions

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ The GridDB CLI provides command line interface tool to manage GridDB cluster ope
1010

1111
Building and program execution are checked in the environment below.
1212

13-
OS: CentOS 7.9(x64) / Ubuntu 20.04
14-
GridDB Server: V5.0 CE(Community Edition)
15-
Java: Java™ SE Development Kit 8
13+
OS: CentOS 7.9(x64)
14+
GridDB Server: V5.3 CE(Community Edition)
15+
Java: Java™ SE Development Kit 11 (OpenJDK 11.0.19)
1616

1717
## Quick start from CLI Source Code
1818

@@ -44,7 +44,7 @@ and the following file is created under `release/` folder.
4444
Run GridDB CLI after build with ant:
4545

4646
$ CP=.
47-
$ CP=$CP:common/lib/commons-io-2.4.jar:release/griddb-cli.jar:common/lib/gridstore.jar:common/lib/gridstore-jdbc.jar:common/lib/jackson-annotations-2.2.3.jar:common/lib/jackson-core-2.2.3.jar:common/lib/jackson-databind-2.2.3.jar:common/lib/javax.json-1.0.jar:common/lib/jersey-client-1.17.1.jar:common/lib/jersey-core-1.17.1.jar:common/lib/orion-ssh2-214.jar:lib/commons-beanutils-1.9.3.jar:lib/commons-cli-1.2.jar:lib/commons-collections-3.2.2.jar:lib/commons-lang3-3.5.jar:lib/commons-logging-1.2.jar:lib/jline-3.17.1.jar:lib/logback-classic-1.0.13.jar:lib/logback-core-1.0.13.jar:lib/opencsv-3.9.jar:lib/slf4j-api-1.7.5.jar
47+
$ CP=$CP:common/lib/commons-io-2.4.jar:release/griddb-cli.jar:common/lib/gridstore.jar:common/lib/gridstore-jdbc.jar:common/lib/jackson-annotations-2.2.3.jar:common/lib/jackson-core-2.2.3.jar:common/lib/jackson-databind-2.2.3.jar:common/lib/javax.json-1.0.jar:common/lib/jersey-client-1.17.1.jar:common/lib/jersey-core-1.17.1.jar:common/lib/orion-ssh2-214.jar:lib/commons-beanutils-1.9.3.jar:lib/commons-cli-1.2.jar:lib/commons-collections-3.2.2.jar:lib/commons-lang3-3.5.jar:lib/commons-logging-1.2.jar:lib/jline-3.21.0.jar:lib/logback-classic-1.0.13.jar:lib/logback-core-1.0.13.jar:lib/opencsv-3.9.jar:lib/slf4j-api-1.7.5.jar
4848
$ java -Xmx1024m -Dlogback.configurationFile=gs_sh_logback.xml -classpath "$CP:$CLASSPATH" com.toshiba.mwcloud.gs.tools.shell.GridStoreShell $*
4949
gs> version
5050
gs_sh-ce version 5.0.0

Specification_en.md

Lines changed: 1334 additions & 434 deletions
Large diffs are not rendered by default.

Specification_ja.md

Lines changed: 1314 additions & 416 deletions
Large diffs are not rendered by default.

build.gradle

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ sourceSets {
1515
}
1616
}
1717

18-
def gridstoreVersion = '5.0.0'
19-
def gridstoreJdbcVersion = '5.0.0'
18+
def gridstoreVersion = '5.3.0'
19+
def gridstoreJdbcVersion = '5.3.0'
2020

2121
repositories {
2222
mavenCentral()
@@ -40,6 +40,7 @@ dependencies {
4040
implementation 'com.github.griddb:gridstore:' + "${gridstoreVersion}"
4141
implementation 'com.github.griddb:gridstore-jdbc:' + "${gridstoreJdbcVersion}"
4242
implementation project(":griddb-tools-common")
43+
4344
}
4445

4546
jar {

common/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ sourceSets {
1212
}
1313
}
1414

15-
def gridstoreVersion = '5.0.0'
16-
def gridstoreJdbcVersion = '5.0.0'
15+
def gridstoreVersion = '5.3.0'
16+
def gridstoreJdbcVersion = '5.3.0'
1717

1818
dependencies {
1919
implementation 'commons-io:commons-io:2.4'
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/*
2+
Copyright (c) 2021 TOSHIBA Digital Solutions Corporation.
3+
Licensed under the Apache License, Version 2.0 (the "License");
4+
you may not use this file except in compliance with the License.
5+
You may obtain a copy of the License at
6+
http://www.apache.org/licenses/LICENSE-2.0
7+
Unless required by applicable law or agreed to in writing, software
8+
distributed under the License is distributed on an "AS IS" BASIS,
9+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10+
See the License for the specific language governing permissions and
11+
limitations under the License.
12+
*/
13+
14+
package com.toshiba.mwcloud.gs.tools.common;
15+
16+
/**
17+
* 認証方式(内部認証/LDAP認証)
18+
* <p>
19+
* LDAP,INTERNAL
20+
*
21+
*/
22+
public enum AuthenticationMethod {
23+
LDAP,
24+
INTERNAL
25+
}

common/src/com/toshiba/mwcloud/gs/tools/common/GridStoreCommandUtils.java

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313

1414
package com.toshiba.mwcloud.gs.tools.common;
1515

16+
import java.net.InetAddress;
17+
import java.net.UnknownHostException;
1618
import java.util.ArrayList;
1719
import java.util.List;
1820
import java.util.Map;
@@ -755,6 +757,8 @@ public Boolean call() throws Exception {
755757
int countService = 0;
756758
boolean result = true;
757759
boolean initFlag = true;
760+
// Get list of node in the cluster as IP Address (get from configuration file)
761+
List<NodeKey> nodesIPAddress = getNodesWithIPAddress(cluster.getNodes());
758762

759763
// ノードごとのステータス数などの計算
760764
for ( T obj : cluster.getNodes() ){
@@ -790,7 +794,8 @@ public Boolean call() throws Exception {
790794
.convertValue(followers, NodeKey[].class);
791795

792796
for ( NodeKey nkey : followerKeys ){
793-
if ( cluster.getNode(nkey) == null ){
797+
// Check node information get from API "/node/host" with node information get from configuration file
798+
if (!nodesIPAddress.contains(nkey)) {
794799
// 定義には含まれていない
795800
List<GSNode> undefNodes = clStat.getUndefinedNodes();
796801
if ( undefNodes == null ){
@@ -838,6 +843,44 @@ public Boolean call() throws Exception {
838843
return result;
839844
}
840845

846+
/**
847+
* Convert the address of NodeKey from host name to IPAddress
848+
*
849+
* @param nodeKey node with host name
850+
* @return nodeKey node with IP Address
851+
* @throws GridStoreCommandException if host name and IP Address not found in the /etc/hosts
852+
*/
853+
private static NodeKey convertHostnameToIPAddress(NodeKey nodeKey) throws GridStoreCommandException {
854+
InetAddress inet = null;
855+
NodeKey nodeKeyWithIPAddress = null;
856+
try {
857+
inet = InetAddress.getByName(nodeKey.getAddress());
858+
nodeKeyWithIPAddress = new NodeKey(inet.getHostAddress(), nodeKey.getPort());
859+
} catch (UnknownHostException e) {
860+
throw new GridStoreCommandException("D10137: Failed to get node status. ("+e.getMessage()+")", e);
861+
}
862+
return nodeKeyWithIPAddress;
863+
}
864+
865+
/**
866+
* Get list of node in the cluster as IP Address
867+
*
868+
* @param <T> generic type
869+
* @param nodes list of nodes in the config file
870+
* @return list of node in the cluster with IP Address
871+
* @throws GridStoreCommandException
872+
*/
873+
private static <T> List<NodeKey> getNodesWithIPAddress(List<T> nodes) throws GridStoreCommandException {
874+
List<NodeKey> nodesIPAddress = new ArrayList<NodeKey>();
875+
for (T obj : nodes) {
876+
GSNode node = (GSNode) obj;
877+
NodeKey nodeKey = new NodeKey(node.getAddress(), node.getPort());
878+
nodesIPAddress.add(convertHostnameToIPAddress(nodeKey));
879+
}
880+
return nodesIPAddress;
881+
}
882+
883+
841884
/**
842885
* Get cluster configuration information.
843886
*

common/src/com/toshiba/mwcloud/gs/tools/common/GridStoreWebAPI.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ public static class PartitionInfo {
400400
/**
401401
* Maximum Log Sequence Number.
402402
*/
403-
public int maxLsn;
403+
public long maxLsn;
404404
}
405405

406406
/**
@@ -415,7 +415,7 @@ public static class NodeKeyPartition {
415415
/**
416416
* Log Sequence Number.
417417
*/
418-
public int lsn;
418+
public long lsn;
419419
/**
420420
* Node port.
421421
*/
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/*
2+
Copyright (c) 2021 TOSHIBA Digital Solutions Corporation.
3+
Licensed under the Apache License, Version 2.0 (the "License");
4+
you may not use this file except in compliance with the License.
5+
You may obtain a copy of the License at
6+
http://www.apache.org/licenses/LICENSE-2.0
7+
Unless required by applicable law or agreed to in writing, software
8+
distributed under the License is distributed on an "AS IS" BASIS,
9+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10+
See the License for the specific language governing permissions and
11+
limitations under the License.
12+
*/
13+
14+
package com.toshiba.mwcloud.gs.tools.common;
15+
16+
/**
17+
* SSL接続設定
18+
* <p>
19+
* DISABLED,PREFERRED,VERIFY
20+
*
21+
*/
22+
public enum SslMode {
23+
DISABLED,
24+
PREFERRED,
25+
VERIFY
26+
}

0 commit comments

Comments
 (0)