diff --git a/README.md b/README.md index 87c3348..e949090 100644 --- a/README.md +++ b/README.md @@ -10,8 +10,8 @@ The GridDB CLI provides command line interface tool to manage GridDB cluster ope Building and program execution are checked in the environment below. - OS: CentOS 7.9(x64), Ubuntu 20.04 (x64) - GridDB Server: V5.6 CE(Community Edition) + OS: Ubuntu 22.04 (x64) + GridDB Server: V5.7 CE(Community Edition) Java: OpenJDK 1.8.0 ## Quick start from CLI Source Code @@ -47,7 +47,7 @@ and the following file is created under `release/` folder. $ CP=$CP:common/lib/commons-io-2.15.1.jar:release/griddb-cli.jar:common/lib/gridstore.jar:common/lib/gridstore-jdbc.jar:common/lib/jackson-annotations-2.16.1.jar:common/lib/jackson-core-2.16.1.jar:common/lib/jackson-databind-2.16.1.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.4.jar:lib/commons-cli-1.6.0.jar:lib/commons-collections-3.2.2.jar:lib/commons-lang3-3.14.0.jar:lib/commons-logging-1.3.0.jar:lib/jline-3.21.0.jar:lib/logback-classic-1.2.13.jar:lib/logback-core-1.0.13.jar:lib/opencsv-3.9.jar:lib/slf4j-api-1.7.36.jar $ java -Xmx1024m -Dlogback.configurationFile=gs_sh_logback.xml -classpath "$CP:$CLASSPATH" com.toshiba.mwcloud.gs.tools.shell.GridStoreShell $* gs> version - gs_sh-ce version 5.6.0 + gs_sh-ce version 5.7.0 Run GridDB CLI after build with gradle: @@ -55,25 +55,25 @@ and the following file is created under `release/` folder. $ CP=$CP:release/griddb-cli.jar $ java -Xmx1024m -Dlogback.configurationFile=gs_sh_logback.xml -classpath "$CP:$CLASSPATH" com.toshiba.mwcloud.gs.tools.shell.GridStoreShell $* gs> version - gs_sh-ce version 5.6.0 + gs_sh-ce version 5.7.0 ## Quick start from CLI Package ``` -(CentOS) +(Rocky Linux) $ rpm -ivh griddb-X.X.X-linux.x86_64.rpm $ rpm -ivh griddb-ce-cli-X.X.X-linux.x86_64.rpm $ gs_sh gs> version -gs_sh-ce version 5.6.0 +gs_sh-ce version 5.7.0 (Ubuntu) $ dpkg -i griddb_x.x.x_amd64.deb $ dpkg -i griddb-cli_X.X.X_amd64.deb $ gs_sh gs> version -gs_sh-ce version 5.6.0 +gs_sh-ce version 5.7.0 Note: - X.X.X is the GridDB version. - {release} is the GridDB release version. diff --git a/build.gradle b/build.gradle index 725e0e2..7416078 100644 --- a/build.gradle +++ b/build.gradle @@ -15,8 +15,8 @@ sourceSets { } } -def gridstoreVersion = '5.6.0' -def gridstoreJdbcVersion = '5.6.0' +def gridstoreVersion = '5.7.0' +def gridstoreJdbcVersion = '5.7.0' repositories { mavenCentral() diff --git a/common/build.gradle b/common/build.gradle index cc00f07..c6ff4d2 100644 --- a/common/build.gradle +++ b/common/build.gradle @@ -4,6 +4,8 @@ repositories{ mavenCentral() } +sourceCompatibility = '1.8' + sourceSets { main { java { @@ -12,8 +14,8 @@ sourceSets { } } -def gridstoreVersion = '5.6.0' -def gridstoreJdbcVersion = '5.6.0' +def gridstoreVersion = '5.7.0' +def gridstoreJdbcVersion = '5.7.0' dependencies { implementation 'commons-io:commons-io:2.15.1' diff --git a/src/com/toshiba/mwcloud/gs/tools/shell/GridStoreShellMessages.properties b/src/com/toshiba/mwcloud/gs/tools/shell/GridStoreShellMessages.properties index dbdf03c..38026d4 100644 --- a/src/com/toshiba/mwcloud/gs/tools/shell/GridStoreShellMessages.properties +++ b/src/com/toshiba/mwcloud/gs/tools/shell/GridStoreShellMessages.properties @@ -1,4 +1,4 @@ -version=gs_sh version 5.6.0 +version=gs_sh version 5.7.0 help.version=Show version help.help=Show this help diff --git a/src/com/toshiba/mwcloud/gs/tools/shell/GridStoreShellMessages_ja.properties b/src/com/toshiba/mwcloud/gs/tools/shell/GridStoreShellMessages_ja.properties index 669fc08..888eb16 100644 --- a/src/com/toshiba/mwcloud/gs/tools/shell/GridStoreShellMessages_ja.properties +++ b/src/com/toshiba/mwcloud/gs/tools/shell/GridStoreShellMessages_ja.properties @@ -1,4 +1,4 @@ -version=gs_sh version 5.6.0 +version=gs_sh version 5.7.0 help.version=Show version help.help=Show this help diff --git a/src/com/toshiba/mwcloud/gs/tools/shell/commands/DataCommandClass.java b/src/com/toshiba/mwcloud/gs/tools/shell/commands/DataCommandClass.java index 9b70bc4..37a64d9 100644 --- a/src/com/toshiba/mwcloud/gs/tools/shell/commands/DataCommandClass.java +++ b/src/com/toshiba/mwcloud/gs/tools/shell/commands/DataCommandClass.java @@ -113,6 +113,7 @@ import javax.script.ScriptContext; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.OutOfMemoryError; /** Data command class contains some commands to execute data operation. */ public class DataCommandClass extends AbstractCommandClass { @@ -3211,6 +3212,9 @@ private int getRowSQL(Integer count, boolean replaceNull, String[] vals) { return rowNo; + } catch (OutOfMemoryError oome) { + removeResultTable(); + throw new ShellException(getMessage("error.outOfMemory")); } catch (ShellException e) { throw e; } catch (Exception e) { @@ -3225,6 +3229,7 @@ private int getRowSQL(Integer count, boolean replaceNull, String[] vals) { } protected void displayAsTable() {}; + protected void removeResultTable() {}; /** * 検索結果1件を取得し、カラム値を取得します。(NoSQL) @@ -3304,7 +3309,9 @@ protected void displayAsTable() { this.resultTable.display(); } } - + protected void removeResultTable() { + this.resultTable = null; + } }; int gotCount = 0; @@ -5348,7 +5355,7 @@ private void outputPlanJson(ExplainResult explainResult, String fileName) { for (JsonNode explainJson : explainJsonList) { explains.add(explainJson); } - root.put("nodeList", explains); + root.set("nodeList", explains); String outputStr = ""; try { diff --git a/src/com/toshiba/mwcloud/gs/tools/shell/commands/DataCommandClassMessages.properties b/src/com/toshiba/mwcloud/gs/tools/shell/commands/DataCommandClassMessages.properties index 747424d..6adfbec 100644 --- a/src/com/toshiba/mwcloud/gs/tools/shell/commands/DataCommandClassMessages.properties +++ b/src/com/toshiba/mwcloud/gs/tools/shell/commands/DataCommandClassMessages.properties @@ -495,6 +495,7 @@ error.tooManyVariables=D20438: The number of variables specified is greater than error.getvalExplain=D20439: The result of an EXPLAIN statement cannot be defined in a variable. error.getrowval=D20440: An unexpected error occurred while getting results. error.longVariableName=D20441: Specify the variable name within 256 bytes. +error.outOfMemory=D20442: The standard output result exceeded the Java heap size of gs_sh. Please increase the Java heap size of /bin/gs_sh or output the result using the getcsv command. error.invalidVarName=D20106: {0} can not be used as a variable name. error.illegalEnum=D20407: This argument {0} is incorrect. An acceptable argument is {1}. diff --git a/src/com/toshiba/mwcloud/gs/tools/shell/commands/DataCommandClassMessages_ja.properties b/src/com/toshiba/mwcloud/gs/tools/shell/commands/DataCommandClassMessages_ja.properties index 47a6679..b078a20 100644 --- a/src/com/toshiba/mwcloud/gs/tools/shell/commands/DataCommandClassMessages_ja.properties +++ b/src/com/toshiba/mwcloud/gs/tools/shell/commands/DataCommandClassMessages_ja.properties @@ -483,6 +483,7 @@ error.tooManyVariables=D20438: \u6307\u5B9A\u3055\u308C\u305F\u5909\u6570\u306E\ error.getvalExplain=D20439: EXPLAIN\u6587\u306E\u7D50\u679C\u306F\u5909\u6570\u306B\u5B9A\u7FA9\u3067\u304D\u307E\u305B\u3093\u3002 error.getrowval=D20440: \u691C\u7D22\u7D50\u679C\u306E\u53D6\u5F97\u3067\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F\u3002 error.longVariableName=D20441: \u5909\u6570\u540D\u306F256\u6587\u5B57\u4EE5\u5185\u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002 +error.outOfMemory=D20442: \u6a19\u6e96\u51fa\u529b\u306e\u7d50\u679c\u304cgs_sh\u306eJava\u30d2\u30fc\u30d7\u30b5\u30a4\u30ba\u3092\u8d85\u3048\u307e\u3057\u305f\u3002\/bin\/gs_sh\u306eJava\u30d2\u30fc\u30d7\u30b5\u30a4\u30ba\u3092\u5897\u3084\u3059\u304b\u3001\u3082\u3057\u304f\u306fgetcsv\u30b3\u30de\u30f3\u30c9\u3067\u7d50\u679c\u3092\u51fa\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002 error.invalidVarName=D20106: {0} \u306F\u5909\u6570\u540D\u3068\u3057\u3066\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093\u3002 error.illegalEnum=D20407: {0} \u306f\u5f15\u6570\u3068\u3057\u3066\u6b63\u3057\u304f\u3042\u308a\u307e\u305b\u3093\u3002{1}\u306e\u307f\u304c\u6307\u5b9a\u3067\u304d\u307e\u3059\u3002