From cdafc7d5b23cdb1412e53637c47b1d09868b29c4 Mon Sep 17 00:00:00 2001 From: Yuce Tekol Date: Wed, 10 Jan 2024 20:08:07 +0300 Subject: [PATCH 1/8] Updated docs --- .../ROOT/pages/advanced-scripting.adoc | 82 +++++++++--------- docs/modules/ROOT/pages/clc-sql.adoc | 23 +++-- docs/modules/ROOT/pages/get-started.adoc | 49 +++-------- .../ROOT/pages/jet-job-management.adoc | 84 +++++-------------- .../pages/managing-viridian-clusters.adoc | 39 +++++---- docs/modules/ROOT/pages/overview.adoc | 54 ++++++++++-- 6 files changed, 156 insertions(+), 175 deletions(-) diff --git a/docs/modules/ROOT/pages/advanced-scripting.adoc b/docs/modules/ROOT/pages/advanced-scripting.adoc index 749641c..e5ebde3 100644 --- a/docs/modules/ROOT/pages/advanced-scripting.adoc +++ b/docs/modules/ROOT/pages/advanced-scripting.adoc @@ -70,7 +70,7 @@ You are ready to run the script: [source,bash] ---- -clc script hello.star +clc script run hello.star ---- The output is similar to: @@ -125,7 +125,7 @@ Running it: [source,bash] ---- -clc script data_value.star +clc script run data_value.star ---- Outputs: @@ -138,7 +138,7 @@ You can use the following methods and functions with a data object: * `X.type`: Returns the serialization identifier. * `data_type(X)`: Returns the name of the serializer. -* `data_value(X)`: Deserializes the value. Note that CLC cannot deserialize all values. An error will be raised in case the value was not deserialized. +* `decode_data(X)`: Deserializes the value. Note that CLC cannot deserialize all values. An error will be raised in case the value was not deserialized. These methods are summarized in the following script, which you can save as `data_value2.star`: @@ -149,14 +149,14 @@ obj = map_get("some-key") print("String value of the data object :", obj) print("Numeric type of the enclosed object :", obj.type) print("String value of the enclosed object :", data_type(obj)) -print("The deserialized object :", data_value(obj)) +print("The deserialized object :", decode_data(obj)) ---- Running it: [source,bash] ---- -clc script data_value2.star +clc script run data_value2.star ---- Outputs: @@ -237,20 +237,20 @@ def main(): print("Map size:", map_size(name=map_name)) for i in range(3): value = map_get(i, name=map_name) - decoded_value = data_value(value) + decoded_value = decode_data(value) print("Value:", decoded_value) ---- Running this script outputs: ---- Map size: 3 -Data for 0 is data(STRING) and its value is value-0 -Data for 1 is data(STRING) and its value is value-1 -Data for 2 is data(STRING) and its value is value-2 ----- +Value: value-0 +Value: value-1 +Value: value-2 +~---- Note the `value = map_get(i, name=map_name)` line. The `map_get` function returns the encoded data, not the actual value you passed to `map_set`. -This behavior differs from official Hazelcast client libraries, which decode the data and return the decoded the value. +This behavior differs from official Hazelcast client libraries, which decode the data and return the decoded value. The reason for this behavior is covered in the <> section. `map_key_set` returns the list of keys for a member. To make the above example more robust by getting the keys from the cluster instead of manually specifying them. @@ -264,7 +264,7 @@ def main(): print("Map size:", map_size(name=map_name)) for key in map_key_set(name=map_name): value = map_get(key, name=map_name) - decoded_value = data_value(value) + decoded_value = decode_data(value) print("Value:", decoded_value) ----- @@ -279,7 +279,7 @@ def main(): map_set(i, "value-{}".format(i), name=map_name) print("Map size:", map_size(name=map_name)) for key, value in map_entry_set(name=map_name): - decoded_value = data_value(value) + decoded_value = decode_data(value) print("Value:", decoded_value) ----- @@ -307,7 +307,7 @@ def main(): + [source,bash] ---- -clc script args.star +clc script run args.star ---- + Output: @@ -320,7 +320,7 @@ Script : args.star + [source,bash] ---- -clc script args.star -- foo bar quux +clc script run args.star -- foo bar quux ---- + Output: @@ -337,7 +337,7 @@ Remember that flags have a dash (`-`) as a prefix: + [source,bash] ---- -clc script args.star -- foo --my-flag +clc script run args.star -- foo --my-flag ---- + Output: @@ -385,7 +385,7 @@ print("My home directory:", user_home) `now()` function returns the current local time in nanoseconds. -You can convert the time to other units using the predefined time units, such as `millisecond`, `second` and `day`. +You can convert the time to other units using the predefined time units, such as `MILLISECOND`, `SECOND` and `DAY`. For the valid values, see the link:clc-script.adoc[clc script] topic. The following example measures the duration of an object_list operation, and prints the result in various time units. @@ -407,10 +407,10 @@ toc = now() took = toc - tic print("The operation took:") -print(" ", took//nanosecond, "nanoseconds") -print(" ", took//microsecond, "microseconds") -print(" ", took//millisecond, "milliseconds") -print(" ", took//second, "seconds") +print(" ", took//NANOSECOND, "nanoseconds") +print(" ", took//MICROSECOND, "microseconds") +print(" ", took//MILLISECOND, "milliseconds") +print(" ", took//SECOND, "seconds") ---- Running it outputs: @@ -432,7 +432,7 @@ Here's a script that just waits for two seconds. [source,python] ---- print("Falling asleep...") -sleep(2*second) +sleep(2*SECOND) print("Woke up") ---- @@ -467,7 +467,7 @@ Otherwise they would written to the default log file. [source, bash] ---- -clc script --log.path stderr --log.level error logging.star +clc script run --log.path stderr --log.level error logging.star ---- As this specifies ERROR level log messages, the output is similar to the following: @@ -481,7 +481,7 @@ This time with DEBUG: [source, bash] ---- -clc script --log.path stderr --log.level debug logging.star +clc script run --log.path stderr --log.level debug logging.star ---- This time all log messages are displayed and the output is similar to the following: @@ -517,7 +517,7 @@ fun1() Running the script normally: ---- -clc script trace.star +clc script run trace.star ---- Outputs: ---- @@ -526,7 +526,7 @@ Fun 1 That's because the `__trace` calls are removed. Try again with the `--debug` flag: ---- -clc script --debug trace.star +clc script run --debug trace.star ---- Outputs: ---- @@ -556,7 +556,7 @@ def main(): Let's first run it normally: [source,bash] ---- -clc script output1.star +clc script run output1.star ---- Outputs: @@ -577,7 +577,7 @@ Unnecessary output lines will dissapear when you use -q Let's now use the `-q` flag to suppress unnecessary output: [source,bash] ---- -clc script output1.star -q +clc script run output1.star -q ---- Outputs: @@ -595,7 +595,7 @@ As expected, unnecessary output was not produced. Using a different output format also works: [source,bash] ---- -clc script output1.star -q -f csv +clc script run output1.star -q -f csv ---- Outputs: @@ -611,7 +611,7 @@ This example uses the link:https://jqlang.github.io/jq/[jq] utility: : [source,bash] ---- -clc script output1.star -q -f json | jq '.Fruit' +clc script run output1.star -q -f json | jq '.Fruit' ---- Outputs: ---- @@ -661,7 +661,7 @@ Different output formats handle missing values differently. JSON printer just skips the missing values: [source,bash] ---- -clc script output2.star -f json +clc script run output2.star -f json ---- Outputs: ---- @@ -676,17 +676,17 @@ Whenever an error occurs, CLC stops the script and prints an error message. This is usually the safest way to handle the error. But there are times when you want to try something that can result in an error, and handle it without giving back the control. -The `script` command supports `the --ignore-errors` flag which suppresses errors while running the script. +The `script` command supports the `--ignore-errors` flag which suppresses errors while running the script. You can use the `last_error()` function to get the error so you can act on it. -Let's demonstrate that with an example using the `data_value` function. -Passing a string to `data_value` ends with an error; since that function expects an argument of type `data`. +Let's demonstrate that with an example using the `decode_data` function. +Passing a string to `decode_data` ends with an error; since that function expects an argument of type `data`. Save the following sctipt as `error.star`: [source,python] ---- def main(): - v = data_value("foo") + v = decode_data("foo") print(v) ---- @@ -694,19 +694,19 @@ And run it: [source,bash] ---- -clc script error.star +clc script run error.star ---- This displays the following error: ---- -ERROR Error.star:2:19: argument 1 is expected to be 'serialization.Data', got 'string' + ERROR At error.star:2:19: expected argument 'value' to be data, got string ---- This time, run the script with the `--ignore-errors` flag: [source,bash] ---- -clc script --ignore-errors error.star +clc script run --ignore-errors error.star ---- The output is now similar to the following: @@ -722,7 +722,7 @@ Save the following script as `error2.star`: [source,python] ---- def main(): - v = data_value("foo") + v = decode_data("foo") if last_error(): v = "OK Caught the error." print(v) @@ -731,7 +731,7 @@ def main(): Run the script with the `--ignore-errors` flag: [source,bash] ---- -clc script --ignore-errors error2.star +clc script run --ignore-errors error2.star ---- This time the output is: @@ -739,7 +739,7 @@ This time the output is: ---- OK Caught the error. ---- -Since you have used the `--ignore-errors` flag, the program didn't end with an error in the `data_value` line but the error was recorded. +Since you have used the `--ignore-errors` flag, the program didn't end with an error in the `decode_data` line but the error was recorded. Using the `last_error` function, the existence of an error was checked and `v` was set to `OK Caught the error.`. == Conclusion diff --git a/docs/modules/ROOT/pages/clc-sql.adoc b/docs/modules/ROOT/pages/clc-sql.adoc index 287ce0f..cb8e105 100644 --- a/docs/modules/ROOT/pages/clc-sql.adoc +++ b/docs/modules/ROOT/pages/clc-sql.adoc @@ -16,15 +16,10 @@ Parameters: |=== |Parameter|Required|Description|Default -|`--format`, `-f` +|`--use-mapping-suggestion` |Optional -|Output format. Supported formats: - -- `csv` -- `delimited` -- `json` -- `table` -|`delimited` in non-interactive mode, `table` in interactive mode. +|Executes the proposed `CREATE MAPPING` suggestion and retries the query. +|`false` |=== @@ -46,10 +41,14 @@ Non-Interactive mode:: [source,bash] ---- $ clc sql -c prod "SELECT * from cities" -1 United Kingdom London 9540576 -4 United States Los Angeles 3985520 -5 Turkey Ankara 5309690 -7 Brazil Sao Paulo 22429800 +--------------------------------------------------------------------------------- + __key | country | city | population +--------------------------------------------------------------------------------- + 1 | United Kingdom | London | 9540576 + 4 | United States | Los Angeles | 3985520 + 5 | Turkey | Ankara | 5309690 + 7 | Brazil | Sao Paulo | 22429800 +--------------------------------------------------------------------------------- ---- -- Interactive mode:: diff --git a/docs/modules/ROOT/pages/get-started.adoc b/docs/modules/ROOT/pages/get-started.adoc index 958041d..66f8af8 100644 --- a/docs/modules/ROOT/pages/get-started.adoc +++ b/docs/modules/ROOT/pages/get-started.adoc @@ -22,7 +22,7 @@ To allow the Hazelcast CLC to to interact with {hazelcast-cloud} clusters, you m clc viridian login ---- -. When prompted, enter your API key and secret. If both are correct, the token is retrieved and saved. +. When prompted, enter your API key and secret. If both are correct, the token is retrieved and saved. You don't have to run this command again unless you change your API key. == Step 2. Create Two Clusters on {hazelcast-cloud} @@ -52,7 +52,7 @@ clc viridian create-cluster --name Test2 clc viridian list-clusters ---- + -The details of all clusters linked to your {hazelcast-cloud} account are returned, including the Cluster ID, Cluster Name, Current Status, Hazelcast Version. +The details of all clusters linked to your {hazelcast-cloud} account are returned, including the Cluster ID, Cluster Name, Cluster State, Hazelcast Version. [[step-2-prod-configure]] @@ -81,12 +81,10 @@ clc -c Test1 [source, shell] ---- > \object list -Connected to cluster: pr- + OK No objects found. ---- + As this is a new cluster, no objects are returned. -+ -NOTE: This command shows the cluster ID prefixed with `pr` instead of the cluster name. You can see the cluster ID in *Cluster Details* on the {hazelcast-cloud} console. . Press kbd:[Ctrl+D] or type `\exit` to shut down the Hazelcast CLC while you complete the configuration of your second production cluster. @@ -200,53 +198,30 @@ SELECT * FROM currencydata ORDER BY Code; ---- + . Save your script as `myscript.sql`. - -[tabs] -==== -Linux and macOS:: -+ --- -. To run the script on your Test1 cluster, execute the following command. ++. To run the script on your Test1 cluster, execute the following command. + [source,shell] ---- -cat myscript.sql | clc -c Test1 +clc -c Test1 script run myscript.sql ---- + . Then, to run the script on your Test2 cluster, execute the same command replacing the cluster name. + [source,shell] ---- -cat myscript.sql | clc -c Test2 +clc -c Test2 script run myscript.sql ---- --- -Windows:: -+ --- -. To run the script on your Test1 cluster, execute the following command. -+ -[source,shell] ----- -type myscript.sql | clc -c Test1 ----- -+ -. Then, to run the script on your Test2 cluster, execute the same command replacing the cluster name. -+ -[source,shell] ----- -type myscript.sql | clc -c Test2 ----- +== Step 7. Clean Up --- -==== -== Step 7. Clean Up To delete both test clusters from your account. - -. link:https://viridian.hazelcast.com/[Sign in to {hazelcast-cloud}] and select a test cluster. -. Click *Delete* and confirm your deletion. +[source,shell] +---- +clc viridian delete-cluster Test1 +clc viridian delete-cluster Test2 +---- == Summary diff --git a/docs/modules/ROOT/pages/jet-job-management.adoc b/docs/modules/ROOT/pages/jet-job-management.adoc index cad6dc0..0899273 100644 --- a/docs/modules/ROOT/pages/jet-job-management.adoc +++ b/docs/modules/ROOT/pages/jet-job-management.adoc @@ -10,7 +10,7 @@ You need the following: - xref:install-clc.adoc[Hazelcast CLC] installed on your local machine - One running {hazelcast-cloud} cluster. You can create a xref:managing-viridian-clusters.adoc#creating-a-cluster-on-viridian[development cluster] using the Hazelcast CLC. - xref:cloud:ROOT:developer.adoc[{hazelcast-cloud} API key and secret] -- JRE 8 or above. +- JRE 11 or above. - Gradle 8 or above. [[step-1-authenticating-with-viridian]] @@ -58,28 +58,18 @@ Now you're ready to build the sample Jet job. . Clone the GitHub repository. + -[tabs] -==== -HTTPS:: -+ --- -```bash +[source,shell] +---- git clone https://github.com/hazelcast/hazelcast-commandline-client +---- +. Switch to the project directory. +[source,shell] +---- cd hazelcast-commandline-client/examples/platform/simple-streaming-pipeline -``` --- -SSH:: -+ --- -```bash -git clone git@github.com:hazelcast/hazelcast-commandline-client.git +---- + -cd hazelcast-commandline-client/examples/platform/simple-streaming-pipeline -``` --- -==== -+ . Build the project with the following command: + @@ -108,63 +98,35 @@ The Hazelcast CLC waits until the job starts to run. ---- clc -c dev job list ---- -+ -. See how the size of `my-map` increases as entries are written to it. -+ -[tabs] -==== -Unix:: -+ -. Create a new shell script in your favorite text editor. For example: + +. Create a new advanced script in your favorite text editor. For example: + [source,shell] ---- -vi monitor.sh +nano monitor.star ---- + . Add the following: + -[source,shell] +[source,python] ---- -#! /bin/bash -while true; -do clc -c dev map size -n my-map; sleep 3; -done +def main(): + for i in range(1000): + size = map_size(name="my-map") + print(size) + sleep(3 * SECOND) ---- . Run your script. + [source,shell] ---- -./monitor.sh +clc -c dev script run monitor.star ---- -. Press kbd:[Ctrl + C] when you're ready to cancel the script. -Windows:: -+ -. Create a new batch file in your favorite text editor. For example: -+ -[source,shell] ----- -notepad monitor.bat ----- -. Add the following: -+ -[source,shell] ----- -@echo off -:start -clc -c dev map size -n my-map -timeout 5 -goto start ----- -. Run the batch file. -+ -[source,shell] ----- -monitor ----- -. Press kbd:[Ctrl + C] when you're ready to cancel the script. -==== +. See how the size of `my-map` increases as entries are written to it. + +. Press kbd:[Ctrl + C] when you're ready to stop the script. [[step-6-cancel-jet-job]] == Step 6. Cancel the Jet job diff --git a/docs/modules/ROOT/pages/managing-viridian-clusters.adoc b/docs/modules/ROOT/pages/managing-viridian-clusters.adoc index 7840e3a..b90239d 100644 --- a/docs/modules/ROOT/pages/managing-viridian-clusters.adoc +++ b/docs/modules/ROOT/pages/managing-viridian-clusters.adoc @@ -28,8 +28,8 @@ clc viridian login + [source, bash] ---- -Viridian token was fetched and saved. -OK + OK [1/2] Retrieved the access token. + OK [2/2] Saved the access token. ---- + If an error is displayed, make sure that your API key and secret are correct and try again. @@ -40,15 +40,17 @@ Next, execute the following command to create a development cluster called `my-c [source, bash] ---- -clc viridian create-cluster --name my-cluster +clc viridian create-cluster --development --name my-cluster ---- You should see the following output. [source, bash] ---- -Imported configuration: my-cluster -OK + OK [1/3] Initiated cluster creation. + OK [2/3] Cluster is ready. + OK [3/3] Imported the configuration. + OK Created the cluster and imported configuration 'my-cluster'. ---- [[step-3-list-cluster]] @@ -64,8 +66,11 @@ The details of all clusters linked to your {hazelcast-cloud} account are returne [source, bash, subs="attributes+"] ---- -x1qvpphn my-cluster RUNNING {full-version} -OK +----------------------------------------------------- + ID | Name | State | Hazelcast Version +----------------------------------------------------- + nxdzeerp | my-cluster | RUNNING | 5.3.6 +----------------------------------------------------- ---- == Step 4. Create Some Data on Your Cluster @@ -93,8 +98,11 @@ You should see the following output. + [source, bash] ---- -my-value -OK +---------- + this +---------- + my-value +---------- ---- == Step 5. Downloading the Cluster Logs @@ -109,13 +117,6 @@ clc viridian download-logs my-cluster ---- + In this command `my-cluster` is the cluster name rather than the configuration name. -+ -. Use the following command to quickly check the location of your working directory. -+ -[source, bash] ----- -clc home ----- . Now, try downloading the logs to a directory of your choice by adding the `--output-dir` flag. Replace the placeholder `$DIRECTORY_PATH` with the absolute or relative path to your chosen directory. + @@ -142,15 +143,17 @@ clc viridian stop-cluster my-cluster clc viridian resume-cluster my-cluster ---- +. If you get the `Cannot resume cluster because state 'STOP_IN_PROGRESS' cannot be transitioned into 'RESUME_IN_PROGRESS'` error, wait a couple of minutes and try again. + == Step 7. Delete Your Cluster You can also xref:cloud:ROOT:deleting-a-cluster.adoc[delete an existing cluster] on {hazelcast-cloud} using its name or ID. -. Run the following command to delete `my-cluster` replacing the placeholder `CLUSTER_ID`. See <>, for details of how to look up a cluster ID. +. Run the following command to delete `my-cluster` + [source, bash] ---- -clc viridian delete-cluster $CLUSTER_ID +clc viridian delete-cluster my-cluster ---- + A confirmation message is displayed. diff --git a/docs/modules/ROOT/pages/overview.adoc b/docs/modules/ROOT/pages/overview.adoc index 73b36cf..2a0792a 100644 --- a/docs/modules/ROOT/pages/overview.adoc +++ b/docs/modules/ROOT/pages/overview.adoc @@ -32,31 +32,32 @@ Get xref:clc-map.adoc[direct access to map data] for quick debugging of prototyp === Scripting for Automation -Work in <> to script and execute repetitive administration, integration, or testing tasks. +Write scripts execute repetitive administration, integration, or testing tasks. == Modes -The Hazelcast CLC works in two modes: +The Hazelcast CLC works in three modes: - Non-interactive - Interactive +- Scripting You can easily switch between modes to suit the context in which you're working. [[non-interactive-mode]] === Non-Interactive Mode -This is the default mode for the Hazelcast CLC. You need to manually enter and execute commands at the command line. This mode is useful for scripting. +This is the default mode for the Hazelcast CLC. You need to manually enter and execute commands at the command line. This mode is useful for quickly running one-off commands and using CLC in shell scripts. [source,bash,subs="attributes+"] ---- -clc map -c dev --name myMap set myKey myValue +clc map --name my-map set my-key my-value ---- [[interactive-mode]] === Interactive Mode -Interactive mode presents a shell to you. This mode is useful for exploring CLC commands, and for manual tasks. +Interactive mode presents a shell to you. This mode is useful for running CLC commands and SQL. In this mode, CLC opens a persistent connection to the cluster if necessary. That makes running commands that require a cluster connection slightly faster. To start the Hazelcast CLC in interactive mode, do the following: @@ -78,7 +79,7 @@ In the interactive mode, you can run SQL queries directly. Make sure to add a se --------------------------------------------------------------------------------- ---- -In order to run CLC commands, prefix them with a backslash `\`: +In order to run CLC commands, prefix them with a backslash (`\`): ---- > \object list ------------------------------------ @@ -91,6 +92,47 @@ In order to run CLC commands, prefix them with a backslash `\`: ------------------------------------ ---- +You can enter multiline CLC commands by adding a backslash (`\`) character at the very end of every line, except the last one. +The continuation lines are concatenated, so it may be necessary to put one or more spaces before the backslash: +---- + > \map --name \ +... set my-map \ +... key1 value1 +---- + +If a value contains whitespace, you can wrap it with single or double quotes: +---- +> \map --name set my-map "key with whitespace" "value with whitespace" +> \map --name get my-map "key with whitespace" +----------------------- + this +----------------------- + value with whitespace +----------------------- +---- + +Alternatively, you can escape space character with a backslash: +---- +> \map --name my-map set key\ with\ whitespace value\ with\ whitespace +> \map --name my-map entry-set +--------------------------------------------- + __key | this +--------------------------------------------- + key with whitespace | value with whitespace +--------------------------------------------- +---- + +You must escape backslash characters in values with another backslash: +---- +> \map --name my-map set doc1 "C:\\Users\\Celine L Carmack\\report.doc" +> \map --name my-map get doc1 +-------------------------------------- + this +-------------------------------------- + C:\Users\Celine L Carmack\report.doc +-------------------------------------- +---- + To return to non-interactive mode, use either of the following methods: - Press kbd:[Ctrl + D] From fe27102959fc65cc16755f9afe751e0b6f66090f Mon Sep 17 00:00:00 2001 From: Yuce Tekol Date: Thu, 11 Jan 2024 00:43:03 +0300 Subject: [PATCH 2/8] Updates --- docs/modules/ROOT/nav.adoc | 1 + .../ROOT/pages/advanced-scripting.adoc | 2 +- docs/modules/ROOT/pages/clc-atomic-long.adoc | 156 --------------- docs/modules/ROOT/pages/clc-atomiclong.adoc | 187 ++++++++++++++++++ docs/modules/ROOT/pages/clc-multimap.adoc | 94 ++++----- docs/modules/ROOT/pages/configuration.adoc | 18 +- .../using-compact-serializer-generator.adoc | 51 +++-- 7 files changed, 266 insertions(+), 243 deletions(-) delete mode 100644 docs/modules/ROOT/pages/clc-atomic-long.adoc create mode 100644 docs/modules/ROOT/pages/clc-atomiclong.adoc diff --git a/docs/modules/ROOT/nav.adoc b/docs/modules/ROOT/nav.adoc index ba518e1..8db9f0c 100644 --- a/docs/modules/ROOT/nav.adoc +++ b/docs/modules/ROOT/nav.adoc @@ -21,6 +21,7 @@ .Reference * xref:clc-commands.adoc[Command Reference] ** xref:clc.adoc[] +** xref:clc-atomiclong.adoc[] ** xref:clc-completion.adoc[] ** xref:clc-config.adoc[] ** xref:clc-home.adoc[] diff --git a/docs/modules/ROOT/pages/advanced-scripting.adoc b/docs/modules/ROOT/pages/advanced-scripting.adoc index e5ebde3..e4a526b 100644 --- a/docs/modules/ROOT/pages/advanced-scripting.adoc +++ b/docs/modules/ROOT/pages/advanced-scripting.adoc @@ -246,7 +246,7 @@ Map size: 3 Value: value-0 Value: value-1 Value: value-2 -~---- +---- Note the `value = map_get(i, name=map_name)` line. The `map_get` function returns the encoded data, not the actual value you passed to `map_set`. diff --git a/docs/modules/ROOT/pages/clc-atomic-long.adoc b/docs/modules/ROOT/pages/clc-atomic-long.adoc deleted file mode 100644 index 3d7f8b1..0000000 --- a/docs/modules/ROOT/pages/clc-atomic-long.adoc +++ /dev/null @@ -1,156 +0,0 @@ -= clc atomic-long - -atomic-long commands are a group of AtomicLong operations. - -Usage: - -[source,bash] ----- -clc atomic-long [command] [flags] ----- - -== Commands - -* <> -* <> -* <> -* <> - -== clc atomic-long get - -Get the value of the AtomicLong. - -Usage: - -[source,bash] ----- -clc atomic-long get [flags] ----- - -Parameters: - -[cols="1m,1a,2a,1a"] -|=== -|Parameter|Required|Description|Default - -|`--name`, `-n` -|Optional -|Name of the atomic-long. -|`default` - -|=== - -Example: - -[source,bash] ----- -clc atomic-long get --name transactionCount ----- - -== clc atomic-long set - -Sets the value of the AtomicLong. - -Usage: - -[source,bash] ----- -clc atomic-long set [value] [flags] ----- - -Parameters: - -[cols="1m,1a,2a,1a"] -|=== -|Parameter|Required|Description|Default - -|`--name`, `-n` -|Optional -|Name of the atomic-long. -|`default` - -|`value`, -|Required -|Value to set for the atomic long. -|N/A - -|=== - -Example: - -[source,bash] ----- -clc atomic-long set --name atomicSum 123 ----- - -== clc atomic-long increment-get - -Increment the AtomicLong by the given value. - -Usage: - -[source,bash] ----- -clc atomic-long increment-get [flags] ----- - -Parameters: - -[cols="1m,1a,2a,1a"] -|=== -|Parameter|Required|Description|Default - -|`--name`, `-n` -|Optional -|Name of the AtomicLong. -|`default` - -|`--by` -|Optional -|Value to increment by -|1 - -|=== - -Example: - -[source,bash] ----- -clc atomic-long increment-get --name atomicSum --by 10 ----- - -== clc atomic-long decrement-get - -Decrement the AtomicLong by the given value. - -Usage: - -[source,bash] ----- -clc atomic-long decrement-get [flags] ----- - -Parameters: - -[cols="1m,1a,2a,1a"] -|=== -|Parameter|Required|Description|Default - -|`--name`, `-n` -|Optional -|Name of the AtomicLong. -|`default` - -|`--by` -|Optional -|Value to decrement by -|1 - -|=== - -Example: - -[source,bash] ----- -clc atomic-long decrement-get --name atomicSum --by 10 ----- diff --git a/docs/modules/ROOT/pages/clc-atomiclong.adoc b/docs/modules/ROOT/pages/clc-atomiclong.adoc new file mode 100644 index 0000000..abd4f54 --- /dev/null +++ b/docs/modules/ROOT/pages/clc-atomiclong.adoc @@ -0,0 +1,187 @@ += clc atomiclong + +atomiclong commands are a group of AtomicLong operations. + +Usage: + +[source,bash] +---- +clc atomiclong [command] [flags] +---- + +== Commands + +* <> +* <> +* <> +* <> +* <> + +== clc atomiclong get + +Get the value of the AtomicLong. + +Usage: + +[source,bash] +---- +clc atomiclong get [flags] +---- + +Parameters: + +[cols="1m,1a,2a,1a"] +|=== +|Parameter|Required|Description|Default + +|`--name`, `-n` +|Optional +|Name of the AtomicLong. +|`default` + +|=== + +Example: + +[source,bash] +---- +clc atomiclong get --name transactionCount +---- + +== clc atomiclong set + +Sets the value of the AtomicLong. + +Usage: + +[source,bash] +---- +clc atomiclong set [value] [flags] +---- + +Parameters: + +[cols="1m,1a,2a,1a"] +|=== +|Parameter|Required|Description|Default + +|`--name`, `-n` +|Optional +|Name of the AtomicLong. +|`default` + +|`value`, +|Required +|Value to set for the atomic long. +|N/A + +|=== + +Example: + +[source,bash] +---- +clc atomiclong set --name atomicSum 123 +---- + +== clc atomiclong increment-get + +Increment the AtomicLong by the given value. + +Usage: + +[source,bash] +---- +clc atomiclong increment-get [flags] +---- + +Parameters: + +[cols="1m,1a,2a,1a"] +|=== +|Parameter|Required|Description|Default + +|`--name`, `-n` +|Optional +|Name of the AtomicLong. +|`default` + +|`--by` +|Optional +|Value to increment by +|1 + +|=== + +Example: + +[source,bash] +---- +clc atomiclong increment-get --name atomicSum --by 10 +---- + +== clc atomiclong decrement-get + +Decrement the AtomicLong by the given value. + +Usage: + +[source,bash] +---- +clc atomiclong decrement-get [flags] +---- + +Parameters: + +[cols="1m,1a,2a,1a"] +|=== +|Parameter|Required|Description|Default + +|`--name`, `-n` +|Optional +|Name of the AtomicLong. +|`default` + +|`--by` +|Optional +|Value to decrement by +|1 + +|=== + +Example: + +[source,bash] +---- +clc atomiclong decrement-get --name atomicSum --by 10 +---- + +== clc atomiclong destroy + +Deletes the atomic long and related data. + +Usage: + +[source,bash] +---- +clc atomiclong destroy [flags] +---- + +Parameters: + +[cols="1m,1a,2a,1a"] +|=== +|Parameter|Required|Description|Default + +|`--name`, `-n` +|Optional +|Name of the atomic long. +|`default` + +|`--yes` +|Optional +|Skip confirming the destroy operation. +|`false` + +|=== + diff --git a/docs/modules/ROOT/pages/clc-multimap.adoc b/docs/modules/ROOT/pages/clc-multimap.adoc index 9122d0f..a1920fb 100644 --- a/docs/modules/ROOT/pages/clc-multimap.adoc +++ b/docs/modules/ROOT/pages/clc-multimap.adoc @@ -1,29 +1,29 @@ -= clc multi-map += clc multimap -multi-map commands are a group of MultiMap operations. +multimap commands are a group of MultiMap operations. Usage: [source,bash] ---- -clc multi-map [command] [flags] +clc multimap [command] [flags] ---- == Commands -* <> -* <> -* <> -* <> -* <> -* <> -* <> -* <> -* <> -* <> -* <> +* <> +* <> +* <> +* <> +* <> +* <> +* <> +* <> +* <> +* <> +* <> -== clc multi-map put +== clc multimap put Put a value in the given MultiMap. @@ -31,7 +31,7 @@ Usage: [source,bash] ---- -clc multi-map put [key] [value] [flags] +clc multimap put [key] [value] [flags] ---- Parameters: @@ -71,10 +71,10 @@ Example: [source,bash] ---- -clc multi-map put --key-type string hello --value-type f32 19.94 --name myMultiMap +clc multimap put --key-type string hello --value-type f32 19.94 --name myMultiMap ---- -== clc multi-map get +== clc multimap get Prints entries from the MultiMap. @@ -82,7 +82,7 @@ Usage: [source,bash] ---- -clc multi-map get [key] [flags] +clc multimap get [key] [flags] ---- Parameters: @@ -118,7 +118,7 @@ Parameters: |=== -== clc multi-map remove +== clc multimap remove Remove values from the given MultiMap. @@ -126,7 +126,7 @@ Usage: [source,bash] ---- -clc multi-map remove [key] [flags] +clc multimap remove [key] [flags] ---- Parameters: @@ -166,11 +166,11 @@ Example: [source,bash] ---- -clc multi-map remove --name mymulti-map --key-type string k1 +clc multimap remove --name mymulti-map --key-type string k1 k1 ---- -== clc multi-map size +== clc multimap size Prints the size of the given the MultiMap. @@ -178,7 +178,7 @@ Usage: [source,bash] ---- -clc multi-map size [flags] +clc multimap size [flags] ---- Parameters: @@ -194,7 +194,7 @@ Parameters: |=== -== clc multi-map clear +== clc multimap clear Removes all entries from the MultiMap. @@ -202,7 +202,7 @@ Usage: [source,bash] ---- -clc multi-map clear [flags] +clc multimap clear [flags] ---- Parameters: @@ -223,7 +223,7 @@ Parameters: |=== -== clc multi-map destroy +== clc multimap destroy Deletes the MultiMap and all the data in it. @@ -231,7 +231,7 @@ Usage: [source,bash] ---- -clc multi-map destroy [flags] +clc multimap destroy [flags] ---- Parameters: @@ -256,10 +256,10 @@ Example: [source,bash] ---- -clc multi-map destroy -n myMultiMap +clc multimap destroy -n myMultiMap ---- -== clc multi-map key-set +== clc multimap key-set Gets all the keys of the specified MultiMap. @@ -267,7 +267,7 @@ Usage: [source,bash] ---- -clc multi-map key-set [flags] +clc multimap key-set [flags] ---- Parameters: @@ -297,10 +297,10 @@ Example: [source,bash] ---- -clc multi-map key-set -n myMultiMap +clc multimap key-set -n myMultiMap ---- -== clc multi-map entry-set +== clc multimap entry-set Gets all the entries of the specified MultiMap. @@ -308,7 +308,7 @@ Usage: [source,bash] ---- -clc multi-map entry-set [flags] +clc multimap entry-set [flags] ---- Parameters: @@ -338,10 +338,10 @@ Example: [source,bash] ---- -clc multi-map entry-set -n myMultiMap +clc multimap entry-set -n myMultiMap ---- -== clc multi-map values +== clc multimap values Gets all values of the specified MultiMap. @@ -349,7 +349,7 @@ Usage: [source,bash] ---- -clc multi-map values [flags] +clc multimap values [flags] ---- Parameters: @@ -379,10 +379,10 @@ Example: [source,bash] ---- -clc multi-map values -n myMultiMap +clc multimap values -n myMultiMap ---- -== clc multi-map lock +== clc multimap lock Lock a key in the given MultiMap. @@ -392,7 +392,7 @@ Usage: [source,bash] ---- -clc multi-map lock [key] [flags] +clc multimap lock [key] [flags] ---- Parameters: @@ -417,10 +417,10 @@ Example: [source,bash] ---- -clc multi-map lock 1 +clc multimap lock 1 ---- -== clc multi-map try-lock +== clc multimap try-lock Tries to lock the key of the given the MultiMap. Returns a result without waiting. @@ -430,7 +430,7 @@ Usage: [source,bash] ---- -clc multi-map try-lock [key] [flags] +clc multimap try-lock [key] [flags] ---- Parameters: @@ -455,10 +455,10 @@ Example: [source,bash] ---- -clc multi-map try-lock 1 +clc multimap try-lock 1 ---- -== clc multi-map unlock +== clc multimap unlock Unlock a key in the given MultiMap. @@ -468,7 +468,7 @@ Usage: [source,bash] ---- -clc multi-map unlock [key] [flags] +clc multimap unlock [key] [flags] ---- Parameters: @@ -493,5 +493,5 @@ Example: [source,bash] ---- -clc multi-map unlock 1 +clc multimap unlock 1 ---- \ No newline at end of file diff --git a/docs/modules/ROOT/pages/configuration.adoc b/docs/modules/ROOT/pages/configuration.adoc index 2077147..272fba5 100644 --- a/docs/modules/ROOT/pages/configuration.adoc +++ b/docs/modules/ROOT/pages/configuration.adoc @@ -23,26 +23,22 @@ Known configurations can be directly specified by their names, instead of the fu ---- # List configurations $ clc config list +-------------------- + Configuration Name +-------------------- default pr-3066 +-------------------- # Start CLC shell with configuration named pr-3066 $ clc -c pr-3066 ---- -If no configuration is specified, the `default` configuration is used. +. If no configuration is specified, and there is a single configuration, that configuration is used. +. If there are more than one configurations and the `default` configuration exists, that is used. +. Otherwise CLC displays a selector to choose the cluster. The name of the default configuration may be overriden using the `CLC_CONFIG` environment variable. -If there's only a single named configuration, then it is used if the configuration is not specified with `-c`/`--config`. - -== CLC Configuration with Command-Line Parameters - -Command-line parameters are for overriding some configuration settings in the configuration file, such as the log settings. - -You can override the values in the configuration file by providing the following command-line parameters to any `clc` command: - -include::partial$global-parameters.adoc[] - == Related Resources - xref:connect-to-viridian.adoc[Connecting to {hazelcast-cloud} with Hazelcast CLC]. diff --git a/docs/modules/ROOT/pages/using-compact-serializer-generator.adoc b/docs/modules/ROOT/pages/using-compact-serializer-generator.adoc index 2973172..c4d4b87 100644 --- a/docs/modules/ROOT/pages/using-compact-serializer-generator.adoc +++ b/docs/modules/ROOT/pages/using-compact-serializer-generator.adoc @@ -11,30 +11,28 @@ You need the following: - Hazelcast cluster == Creating Schemas for Business Objects -Let's assume we have the following entities in our application: + +Let's assume you have the following entities in your application: * Student -** ID -** Name +** ID: an integer +** Name: a string * Classroom -** ID -** Students +** ID: an integer +** Students: an array of `Student`. * School -** ID -** Classrooms - -The relationships between these entities are as follows: +** ID: an integer +** Classrooms: an aray of `Classroom`. -* School has classrooms (1->n classrooms) -* Classrooms have students (n->n students) The schema definitions are as follows: [source,yaml] ---- -namespace: "org.example" +serializer: + namespace: org.example.serializers classes: - - name: Student + - name: org.example.Student fields: - name: id type: int32 @@ -44,11 +42,10 @@ classes: [source,yaml] ---- -namespace: "org.example" -imports: - - people.yaml +serializer: + namespace: org.example.serializers classes: - - name: Classroom + - name: org.example.Classroom fields: - name: id type: int32 @@ -58,11 +55,10 @@ classes: [source,yaml] ---- -namespace: "org.example" -imports: - - classroom.yaml +serializer: + namespace: org.example.serializers classes: - - name: School + - name: org.example.School fields: - name: id type: int32 @@ -73,8 +69,7 @@ classes: Schema definitions contain following information: * A description of the content of the `Student`, `Classroom`, and `School` compact classes. -* Any imported schemas, identified using `imports`. -* The namespaces for the schema files, identified using `namespace`. +* The namespaces for the schema files, identified using `serializer.namespace`. == Generating Compact Classes from Schemas @@ -98,11 +93,11 @@ The following classes are generated: * `SchoolSerializer.java` * `ClassroomSerializer.java` -in `com/education` directory. +in `org/example/serializers` directory. == Creating Compact Serialization Configuration -The `generate` command lists the configuration options. You can configure the configuration options in any of the following ways: +You can configure the configuration options in any of the following ways: * Java Configuration * XML Configuration @@ -115,9 +110,9 @@ In the following code, we use the Java configuration to register the generated c ClientConfig clientConfig = new ClientConfig(); clientConfig.getSerializationConfig() .getCompactSerializationConfig() - .setSerializers(new com.education.ClassroomSerializer(), - new com.education.StudentSerializer(), - new com.education.SchoolSerializer()); + .setSerializers(new com.example.serializers.ClassroomSerializer(), + new com.example.serializers.StudentSerializer(), + new com.example.serializers.SchoolSerializer()); ---- == Using SQL Support From e9321a600119c215196c53bc4434b133861171b6 Mon Sep 17 00:00:00 2001 From: Yuce Tekol Date: Thu, 11 Jan 2024 09:13:54 +0300 Subject: [PATCH 3/8] Updated docs --- docs/modules/ROOT/nav.adoc | 23 +- docs/modules/ROOT/pages/alias.adoc | 32 +- docs/modules/ROOT/pages/clc-atomiclong.adoc | 1 + .../ROOT/pages/clc-atomicreference.adoc | 393 ++++++++++++++++++ docs/modules/ROOT/pages/clc-commands.adoc | 49 +-- .../ROOT/pages/clc-serializer-generator.adoc | 142 ------- docs/modules/ROOT/pages/clc-serializer.adoc | 139 ++++--- docs/modules/ROOT/pages/def.adoc | 4 +- docs/modules/ROOT/pages/echo.adoc | 6 +- docs/modules/ROOT/pages/exit.adoc | 22 +- 10 files changed, 517 insertions(+), 294 deletions(-) create mode 100644 docs/modules/ROOT/pages/clc-atomicreference.adoc delete mode 100644 docs/modules/ROOT/pages/clc-serializer-generator.adoc diff --git a/docs/modules/ROOT/nav.adoc b/docs/modules/ROOT/nav.adoc index 8db9f0c..9e7e1d3 100644 --- a/docs/modules/ROOT/nav.adoc +++ b/docs/modules/ROOT/nav.adoc @@ -22,28 +22,31 @@ * xref:clc-commands.adoc[Command Reference] ** xref:clc.adoc[] ** xref:clc-atomiclong.adoc[] +** xref:clc-atomicreference.adoc[] ** xref:clc-completion.adoc[] ** xref:clc-config.adoc[] +** xref:clc-demo.adoc[] ** xref:clc-home.adoc[] ** xref:clc-job.adoc[] -** xref:clc-object.adoc[] +** xref:clc-list.adoc[] ** xref:clc-map.adoc[] -** xref:clc-set.adoc[] -** xref:clc-queue.adoc[] -** xref:clc-topic.adoc[] ** xref:clc-multimap.adoc[] +** xref:clc-object.adoc[] +** xref:clc-project.adoc[] +** xref:clc-queue.adoc[] ** xref:clc-script.adoc[] -** xref:clc-sql.adoc[] +** xref:clc-serializer.adoc[] +** xref:clc-set.adoc[] ** xref:clc-snapshot.adoc[] +** xref:clc-sql.adoc[] +** xref:clc-template.adoc[] +** xref:clc-topic.adoc[] ** xref:clc-version.adoc[] ** xref:clc-viridian.adoc[] -** xref:clc-project.adoc[] -** xref:clc-template.adoc[] -** xref:def.adoc[] ** xref:alias.adoc[] -** xref:clc-serializer-generator.adoc[] -** xref:exit.adoc[] +** xref:def.adoc[] ** xref:echo.adoc[] +** xref:exit.adoc[] * xref:configuration-format.adoc[] * xref:environment-variables.adoc[] * xref:keyboard-shortcuts.adoc[] diff --git a/docs/modules/ROOT/pages/alias.adoc b/docs/modules/ROOT/pages/alias.adoc index 8e6f802..6ebcb2f 100644 --- a/docs/modules/ROOT/pages/alias.adoc +++ b/docs/modules/ROOT/pages/alias.adoc @@ -1,4 +1,4 @@ -= User Defined Aliases += \alias Alias commands enable you to add and list user defined shortcuts. @@ -6,20 +6,22 @@ In order to persist the aliases you need to add `\alias add` statements in the ` NOTE: Alias commands can only be used in the interactive and scripting modes. +Aliases can be used with the `@` prefix. For example, an alias named `my-alias` can be used as `@my-alias`. + Usage: [source,bash] ---- -clc alias [command] +\alias [command] ---- == Commands -* <> -* <> -* <> +* <> +* <> +* <> -== clc alias add +== \alias add Add an alias with the given name and command. @@ -50,7 +52,6 @@ Parameters: | | -| |=== Examples: @@ -58,16 +59,16 @@ Examples: - Adds an alias to list maps in the cluster: [source,bash] ---- -clc alias add list-maps -- \\object list map +\alias add list-maps -- \\object list map ---- - Adds an alias to query SQL: [source,bash] ---- -clc alias add first-five-desserts -- select name from desserts order by name limit 5; +\alias add first-five-desserts -- select name from desserts order by name limit 5; ---- -== clc alias remove +== \alias remove Remove an alias with the given name. @@ -75,7 +76,7 @@ Usage: [source,bash] ---- -clc alias remove [name] +\alias remove [name] ---- Parameters: @@ -89,17 +90,16 @@ Parameters: |Name of the alias. | -| |=== Example: [source,bash] ---- -clc alias remove my-alias +\alias remove my-alias ---- -== clc alias list +== \alias list List existing aliases. @@ -107,14 +107,14 @@ Usage: [source,bash] ---- -clc alias list +\alias list ---- Example: [source,bash] ---- -clc alias list +\alias list ---- === Alias Usage diff --git a/docs/modules/ROOT/pages/clc-atomiclong.adoc b/docs/modules/ROOT/pages/clc-atomiclong.adoc index abd4f54..92bd97f 100644 --- a/docs/modules/ROOT/pages/clc-atomiclong.adoc +++ b/docs/modules/ROOT/pages/clc-atomiclong.adoc @@ -159,6 +159,7 @@ clc atomiclong decrement-get --name atomicSum --by 10 == clc atomiclong destroy Deletes the atomic long and related data. +Once destroyed, an AtomicLong with the same name cannot be used. Usage: diff --git a/docs/modules/ROOT/pages/clc-atomicreference.adoc b/docs/modules/ROOT/pages/clc-atomicreference.adoc new file mode 100644 index 0000000..43f1652 --- /dev/null +++ b/docs/modules/ROOT/pages/clc-atomicreference.adoc @@ -0,0 +1,393 @@ += clc atomicreference + +AtomicReference operations + +Usage: + +[source,bash] +---- +clc atomicreference [command] [flags] +---- + +== Commands + +* <> +* <> +* <> +* <> +* <> +* <> +* <> +* <> + +== clc atomicreference clear + +Deletes the AtomicReference value. + +Usage: + +[source,bash] +---- +clc atomicreference clear [flags] +---- + +Parameters: + +[cols="1m,1a,2a,1a"] +|=== +|Parameter|Required|Description|Default + +|`--name`, `-n` +|Optional +|Name of the AtomicReference. +|`default` + +|=== + +.Global parameters +[%collapsible] +==== +include::partial$global-parameters.adoc[] +==== + +Example: + +[source,bash] +---- +clc atomicreference --name ref1 clear ref1 +---- + +== clc atomicreference compare-and-set + +Sets the value for the given key if it has the expected value. + +Usage: + +[source,bash] +---- +clc atomicreference compare-and-set [expected value] [new value] [flags] +---- + +Parameters: + +[cols="1m,1a,2a,1a"] +|=== +|Parameter|Required|Description|Default + +|`--name`, `-n` +|Optional +|Name of the AtomicReference. +|`default` + +|`expected value`, +|Required +|Old value of the atomic reference. +|N/A + +|`new value`, +|Required +|New value of the atomic reference. +|N/A + +|`--value-type`, `-v` +|Optional +|Data type of the value. One of: `string`, `bool`, `json`, `i8`, `i16`, `i32`, `i64`, `f32`, `f64` +|string + +|`--show-type` +|Optional +|Add a type column to the output. +|`false` + +|=== + +.Global parameters +[%collapsible] +==== +include::partial$global-parameters.adoc[] +==== + +Example: + +[source,bash] +---- +clc atomicreference --name ref1 compare-and-set previous-value next-value +---- + +== clc atomicreference contains + +Checks whether the AtomcReference has the given value. + +Usage: + +[source,bash] +---- +clc atomicreference contains [value] [flags] +---- + +Parameters: + +[cols="1m,1a,2a,1a"] +|=== +|Parameter|Required|Description|Default + +|`--name`, `-n` +|Optional +|Name of the AtomicReference. +|`default` + +|`value`, +|Required +|Value to be checked for existence. +|N/A + +|`--value-type`, `-v` +|Optional +|Data type of the value. One of: `string`, `bool`, `json`, `i8`, `i16`, `i32`, `i64`, `f32`, `f64` +|string + +|`--show-type` +|Optional +|Add a type column to the output. +|`false` + + +|=== + +.Global parameters +[%collapsible] +==== +include::partial$global-parameters.adoc[] +==== + +Example: + +[source,bash] +---- +clc atomicreference --name ref1 contains my-value +---- + +== clc atomicreference get + +Gets the AtomicReference value. + +Usage: + +[source,bash] +---- +clc atomicreference get [value] [flags] +---- + +Parameters: + +[cols="1m,1a,2a,1a"] +|=== +|Parameter|Required|Description|Default + +|`--name`, `-n` +|Optional +|Name of the AtomicReference. +|`default` + +|`value`, +|Required +|Value to be checked for existence. +|N/A + +|`--value-type`, `-v` +|Optional +|Data type of the value. One of: `string`, `bool`, `json`, `i8`, `i16`, `i32`, `i64`, `f32`, `f64` +|string + +|`--show-type` +|Optional +|Add a type column to the output. +|`false` + +|=== + +.Global parameters +[%collapsible] +==== +include::partial$global-parameters.adoc[] +==== + +Example: + +[source,bash] +---- +clc atomicreference --name ref1 get my-value +---- + +== clc atomicreference get-and-set + +Sets a value in the given AtomicReference and returns the old value. + +Usage: + +[source,bash] +---- +clc atomicreference get-and-set [value] [flags] +---- + +Parameters: + +[cols="1m,1a,2a,1a"] +|=== +|Parameter|Required|Description|Default + +|`--name`, `-n` +|Optional +|Name of the AtomicReference. +|`default` + +|`value`, +|Required +|Value to be checked for existence. +|N/A + +|`--value-type`, `-v` +|Optional +|Data type of the value. One of: `string`, `bool`, `json`, `i8`, `i16`, `i32`, `i64`, `f32`, `f64` +|string + +|`--show-type` +|Optional +|Add a type column to the output. +|`false` + +|=== + +.Global parameters +[%collapsible] +==== +include::partial$global-parameters.adoc[] +==== + +Example: + +[source,bash] +---- +clc atomicreference --name ref1 get-and-set my-value +---- + +== clc atomicreference is-null + +Checks whether the stored value in the reference is null. + +Usage: + +[source,bash] +---- +clc atomicreference is-null [flags] +---- + +Parameters: + +[cols="1m,1a,2a,1a"] +|=== +|Parameter|Required|Description|Default + +|`--name`, `-n` +|Optional +|Name of the AtomicReference. +|`default` + +|`--show-type` +|Optional +|Add a type column to the output. +|`false` + +|=== + +.Global parameters +[%collapsible] +==== +include::partial$global-parameters.adoc[] +==== + +Example: + +[source,bash] +---- +clc atomicreference --name ref1 is-null +---- + + +== clc atomicreference set + +Sets a value in the given AtomicReference. + +Usage: + +[source,bash] +---- +clc atomicreference set [value] [flags] +---- + +Parameters: + +[cols="1m,1a,2a,1a"] +|=== +|Parameter|Required|Description|Default + +|`--name`, `-n` +|Optional +|Name of the AtomicReference. +|`default` + +|`value`, +|Required +|Value to be checked for existence. +|N/A + +|`--value-type`, `-v` +|Optional +|Data type of the value. One of: `string`, `bool`, `json`, `i8`, `i16`, `i32`, `i64`, `f32`, `f64` +|string + +|=== + +.Global parameters +[%collapsible] +==== +include::partial$global-parameters.adoc[] +==== + +Example: + +[source,bash] +---- +clc atomicreference --name ref1 set my-value +---- + +== clc atomicreference destroy + +Deletes the AtomicReference and related data. +Once destroyed, an AtomicReference with the same name cannot be used. + +Usage: + +[source,bash] +---- +clc atomicreference destroy [flags] +---- + +Parameters: + +[cols="1m,1a,2a,1a"] +|=== +|Parameter|Required|Description|Default + +|`--name`, `-n` +|Optional +|Name of the atomic reference. +|`default` + +|`--yes` +|Optional +|Skip confirming the destroy operation. +|`false` + +|=== + diff --git a/docs/modules/ROOT/pages/clc-commands.adoc b/docs/modules/ROOT/pages/clc-commands.adoc index 3d88cca..bab43e2 100644 --- a/docs/modules/ROOT/pages/clc-commands.adoc +++ b/docs/modules/ROOT/pages/clc-commands.adoc @@ -7,7 +7,7 @@ [source,bash] ---- -clc [command] [subcommand] [options] +clc [command] [options] ---- You can use `clc [command] help` for information on a specific command. The synopsis for each command shows its parameters and their usage. @@ -15,50 +15,3 @@ You can use `clc [command] help` for information on a specific command. The syno == Global Options include::partial$global-parameters.adoc[] - -== Commands - -[cols="1m,2a"] -|=== -|Command|Description - -|xref:clc.adoc[clc shell] -|Start a Hazelcast CLC shell. - -|clc help -|Display help information for the `clc` command. - -|xref:clc-completion.adoc[clc completion] -|Generate shell autocompletion. - -|xref:clc-home.adoc[clc home] -|Print CLC home directory. - -|xref:clc-config.adoc[clc config] -|Manage the configuration used by the Hazelcast CLC. - -|xref:clc-map.adoc[clc map] -|Manage map data structures. - -|xref:clc-script.adoc[clc script] -|Execute CLC script. - -|xref:clc-sql.adoc[clc sql] -|Execute SQL queries. - -|xref:clc-job.adoc[clc job] -|Create and manage Jet jobs. - -|xref:clc-snapshot.adoc[clc snapshot] -|Manage Jet job snapshots. - -|xref:clc-viridian.adoc[clc viridian] -|{hazelcast-cloud} related operations. - -|xref:clc-object.adoc[clc object] -|Commands for generic distributed data structures. - -|xref:clc-version.adoc[clc version] -|Get version information. - -|=== diff --git a/docs/modules/ROOT/pages/clc-serializer-generator.adoc b/docs/modules/ROOT/pages/clc-serializer-generator.adoc deleted file mode 100644 index a860070..0000000 --- a/docs/modules/ROOT/pages/clc-serializer-generator.adoc +++ /dev/null @@ -1,142 +0,0 @@ -= clc serializer generator (Beta) - -Serializer commands are a group of serializer generator operations. - -For further information, see the link:https://docs.hazelcast.com/hazelcast/latest/serialization/compact-serialization[Compact Serialization] topic. - -Usage: - -[source,bash] ----- -clc serializer [command] [flags] ----- - -== Commands - -* <> - -== clc serializer generate - -Generates compact serialization code from the given schema for the target language. For further information, see the link:https://docs.hazelcast.com/hazelcast/latest/serialization/compact-serialization#implementing-compactserializer[Compact Serialization] section. - - - -Usage: - -[source, bash] ----- -clc serializer generate [schema] [flags] ----- - -Parameters: - -[cols="1m,1a,2a,1a"] -|=== -|Parameter|Required|Description|Default - -|`output-dir`, `-o` -|Optional -|Output directory for the serialization files. -|Current working directory. - -|`language`, `-l` -|Required -|Programming language for which the serializer was created. -| -|=== - -Example: - -[source,bash] ----- -clc serializer generate my-schema.yaml --language java --output-dir my-dir ----- - -=== Schema Creation - -A schema allows you to: - -* Describe the content of a compact class using supported field types -* Import other schema -* Specify namespaces for schema files and reference other namespaces -* Define cyclic references between classes -* Reference classes that are not present in the given schemas - -A schema is written in YAML. The schema format is as follows: - -[source,yaml] ----- -namespace: -# note that other schema files can be imported with relative path to this YAML file -imports: - - someOtherSchema.yaml -# All objects in this file will share the same namespace. -classes: - - name: - fields: - - name: - type: - external: bool # to mark external types (external to this YAML file) ----- - -==== namespace - -Used for logical grouping of classes. Typically, there is a schema file for each namespace. Namespace is optional. If not provided, the classes are generated at the global namespace. When using the namespace, you must provide the language-specific best practice. The tool uses the namespace, if provided, while generating code. - -==== imports - -Used to import other schema files. The type definitions in the imported YAML schemas can be used within the current YAML schema. Any cyclic imports are checked and handled. An import is restricted to a single filename. The tool assumes that all imported YAML files are in the same directory as the schema file that imports them. - -==== classes - -Used to define classes in the schema. - -name: identifies the class being defined by name. - -fields: specifies the fields used by the class, as follows: - -* name: Identifies the field by name -* type: Identifies the field type. If referring to another class, use namespace.classname to identify it; if the class is defined in the same schema YAML file, you can use classname to identify it. You can specify only one type from the following: -** `boolean` -** `boolean[]` -** `int8` -** `int8[]` -** `int16` -** `int16[]` -** `int32` -** `int32[]` -** `int64` -** `int64[]` -** `float32` -** `float32[]` -** `float64` -** `float64[]` -** `string` -** `string[]` -** `date` -** `date[]` -** `time` -** `time[]` -** `timestamp` -** `timestamp[]` -** `timestampWithTimezone` -** `timestampWithTimezone[]` -** `nullableBoolean` -** `nullableBoolean[]` -** `nullableInt8` -** `nullableInt8[]` -** `nullableInt16` -** `nullableInt16[]` -** `nullableInt32` -** `nullableInt32[]` -** `nullableInt64` -** `nullableInt64[]` -** `nullableFloat32` -** `nullableFloat32[]` -** `nullableFloat64` -** `nullableFloat64[]` -** `` -* external: identifies the type as a user-defined implementation. -** The tool does not check whether external fields are imported and available. You are responsible for managing external types; they are not generated by the tool. -** Also identifies mixed use cases where the serializer of an external field is a user-written custom serializer, the zero-config serializer for Java and .NET, or was previously generated by the tool. -** In generated code, external types are imported according to the field `type`. For this reason, in languages such as Java, you must use the full package name with the class; for example, `type: com.app1.dto.Address`. \ No newline at end of file diff --git a/docs/modules/ROOT/pages/clc-serializer.adoc b/docs/modules/ROOT/pages/clc-serializer.adoc index dbb47c2..faf1c54 100644 --- a/docs/modules/ROOT/pages/clc-serializer.adoc +++ b/docs/modules/ROOT/pages/clc-serializer.adoc @@ -1,6 +1,6 @@ -= clc serializer generator (Beta) += clc serializer (Beta) -Serializer commands generate serializers for various serialization systems. +Generates serializer code for various serialization systems. Usage: @@ -61,83 +61,86 @@ A schema allows you to: * Describe the contents of a compact class using supported field types. * Import other schema. * Specify a namespaces for schema files and reference other namespaces. -* Define cyclic references between classes. * Reference classes that are not present in the given schemas. -A schema is written in YAML. Schema format is given below: +Schemas are written in YAML. + +Schema format is given below: [source,yaml] ---- -namespace: -# note that other schema files can be imported with relative path to this yaml file -imports: - - some-other-schema.yaml -# All objects in this file will share the same namespace. +serializer: + namespace: classes: - - name: - fields: - - name: - type: - external: bool # to mark external types (external to this yaml file) + - name: + typename: + fields: + - name: + type: ---- -==== namespace - -Used for logical grouping of classes. Typically, for every namespace, you will have a schema file. Namespace is optional. If not provided, the classes will be generated at global namespace (no namespace). The user should provide the language specific best practice when using the namespace. The tool will use the namespace while generating code if provided. +==== serializer -==== imports +Contains the options for the serializer classes. +The options apply to all serializer classes generated from the classes in this file. -Used to import other schema files. The type definitions in the imported yaml schemas can be used within this yaml file. Cyclic imports will be checked and handled properly. For this version of the tool, an import can only be a single file name and the tool will assume all yaml files imported will be in the same directory as the importing schema file. +* `namespace`: Optional package/namespace of the serializers. If not specified, the package/namespace of the class is used for the serializer. ==== classes -Used to define classes in the schema. - -* name: Name of the class -* fields: Field specification of the class -** name: Name of the field -** type: Type of the field. Normally you should refer to another class as namespace.classname. You can use a class without namespace when the class is defined in the same schema yaml file. type can be one of the following: -*** `boolean` -*** `boolean[]` -*** `int8` -*** `int8[]` -*** `int16` -*** `int16[]` -*** `int32` -*** `int32[]` -*** `int64` -*** `int64[]` -*** `float32` -*** `float32[]` -*** `float64` -*** `float64[]` -*** `string` -*** `string[]` -*** `date` -*** `date[]` -*** `time` -*** `time[]` -*** `timestamp` -*** `timestamp[]` -*** `timestampWithTimezone` -*** `timestampWithTimezone[]` -*** `nullableBoolean` -*** `nullableBoolean[]` -*** `nullableInt8` -*** `nullableInt8[]` -*** `nullableInt16` -*** `nullableInt16[]` -*** `nullableInt32` -*** `nullableInt32[]` -*** `nullableInt64` -*** `nullableInt64[]` -*** `nullableFloat32` -*** `nullableFloat32[]` -*** `nullableFloat64` -*** `nullableFloat64[]` -*** `` -** external: -*** Used to mark if the type is external. If a field is external, the tool will not check if it is imported and available. External types are managed by the user and not generated by the tool. -*** The serializer of an external field can be a custom serializer which is handwritten, the zero-config serializer for Java and .NET, or previously genereated using the tool. This flag will enable such mixed use cases. -*** In generated code, external types are imported exactly what as the "type" of the field, hence for languages like Java the user should enter the full package name together with the class. E.g. type: `com.app1.dto.Address`. +Defines class informations in the schema. + +All class informations have the following attributes: + +* `name`: Full name of the class, including package/namespace. +* `typename`: This is an optional type name to be used. Compact serialization mechanism distinguishes data types in the cluster using their type names. Hence, type names must be unique across the cluster. If not specified, the full type name of the class is used. +* `fields`: Field informations of the class + +A field information has the following attributes: + +* `name`: Name of the field +* `type`: EIther one of the builtin type names llsted below, or full name of the field type, including package/namespace. + +==== Builtin types: + +* boolean +* boolean[] +* int8 +* int8[] +* int16 +* int16[] +* int32 +* int32[] +* int64 +* int64[] +* float32 +* float32[] +* float64 +* float64[] +* string +* string[] +* date +* date[] +* time +* time[] +* timestamp +* timestamp[] +* timestampWithTimezone +* timestampWithTimezone[] +* nullableBoolean +* nullableBoolean[] +* nullableInt8 +* nullableInt8[] +* nullableInt16 +* nullableInt16[] +* nullableInt32 +* nullableInt32[] +* nullableInt64 +* nullableInt64[] +* nullableFloat32 +* nullableFloat32[] +* nullableFloat64 +* nullableFloat64[] +* + diff --git a/docs/modules/ROOT/pages/def.adoc b/docs/modules/ROOT/pages/def.adoc index d2d07b1..1e2cb7d 100644 --- a/docs/modules/ROOT/pages/def.adoc +++ b/docs/modules/ROOT/pages/def.adoc @@ -1,4 +1,4 @@ -= clc def += \def Define a variable with a given name and value. @@ -8,7 +8,7 @@ Usage: [source,bash] ---- -clc def [name] [value] +\def [name] [value] ---- Examples: diff --git a/docs/modules/ROOT/pages/echo.adoc b/docs/modules/ROOT/pages/echo.adoc index 95fda53..ec6e1c3 100644 --- a/docs/modules/ROOT/pages/echo.adoc +++ b/docs/modules/ROOT/pages/echo.adoc @@ -1,4 +1,4 @@ -= echo += \echo Echo command prints the specified string. @@ -8,12 +8,12 @@ Usage: [source,bash] ---- -clc echo {STRING} +\echo {STRING} ---- Example: [source,bash] ---- -clc echo "lorem ipsum" +\echo "lorem ipsum" ---- \ No newline at end of file diff --git a/docs/modules/ROOT/pages/exit.adoc b/docs/modules/ROOT/pages/exit.adoc index 902604f..f4f9efd 100644 --- a/docs/modules/ROOT/pages/exit.adoc +++ b/docs/modules/ROOT/pages/exit.adoc @@ -1,21 +1,33 @@ -= exit += \exit Exits with the specified code. NOTE: Exit command can only be used in the interactive and scripting modes. -If the given code is not in the `[0,255]` range, it exits with code `255`. - Usage: [source,bash] ---- -clc exit [code] +\exit [code] ---- +Parameters: + +[cols="1m,1a,2a,1a"] +|=== +|Parameter|Required|Description|Default + +|`code` +|Required +|The exit code. If the given code is not in the `[0,255]` range, it exits with code `255`. +|N/A + +|=== + + Example: [source,bash] ---- -clc exit 10 +\exit 10 ---- \ No newline at end of file From 41e49931c161478df0db35f5b3f59ff737dd0b8b Mon Sep 17 00:00:00 2001 From: Yuce Tekol Date: Thu, 11 Jan 2024 09:51:15 +0300 Subject: [PATCH 4/8] Updated docs --- docs/modules/ROOT/pages/clc-project.adoc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/modules/ROOT/pages/clc-project.adoc b/docs/modules/ROOT/pages/clc-project.adoc index ab0ec00..8f416ec 100644 --- a/docs/modules/ROOT/pages/clc-project.adoc +++ b/docs/modules/ROOT/pages/clc-project.adoc @@ -40,10 +40,10 @@ Parameters: |The Github organization/user account to search for the templates. |hazelcast-templates -|`template-name` -|Required +|`--template`, `-t` +|Optional |Name of the template. -| +|Template selector is displayed |`placeholder-values` |Optional From 6d7de5131bc88aeb633afb27ebab1d94b1d5490e Mon Sep 17 00:00:00 2001 From: Yuce Tekol Date: Thu, 11 Jan 2024 14:48:19 +0300 Subject: [PATCH 5/8] Updated script reference --- docs/modules/ROOT/pages/clc-script.adoc | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/docs/modules/ROOT/pages/clc-script.adoc b/docs/modules/ROOT/pages/clc-script.adoc index b237315..94afe04 100644 --- a/docs/modules/ROOT/pages/clc-script.adoc +++ b/docs/modules/ROOT/pages/clc-script.adoc @@ -50,25 +50,25 @@ The following values are available for advanced scripts: |=== |Value|Description -|`nanosecond` +|`NANOSECOND` |1 nanoscond. -|`microsecond` +|`MICROSECOND` |1 microsecond in nanoseconds. -|`millisecond` +|`MILLISECOND` |1 millisecond in nanoseconds. -|`second` +|`SECOND` |1 second in nanoseconds. -|`minute` +|`MINUTE` |1 minute in nanoseconds. -|`hour` +|`HOUR` |1 hour in nanoseconds. -|`day` +|`DAY` |1 day in nanoseconds. |=== @@ -85,7 +85,7 @@ The following functions are available for advanced scripts: | `DATA_TYPE_NAME = `data_type(DATA_VALUE)` |Returns the type name of the given data value. -| `VALUE = `data_value(DATA_VALUE)` +| `VALUE = `decode_data(DATA_VALUE)` |Attempts to convert the data value to the corresponding script value. |`ERROR = last_error()` @@ -155,14 +155,14 @@ The following functions are available for advanced scripts: |`VALUES_LIST = map_values(name=MAP_NAME)` |Returns the values in the Map as a list. -|`NANOSECONDS = now()` +|`TIME = now()` |Returns the current time in nanoseconds. |`LIST_OF_SERVICE_OBJECT_PAIRS = object_list()` or `OBJECT = object_list(SERVICE)` |Returns the data structure objects in the -|`sleep(NANOSECONDS)` -|Sleeps for the given nanoseconds. For example, to sleep for 10 seconds: `sleep(10*second)`. +|`sleep(TIME)` +|Sleeps for the given nanoseconds. For example, to sleep for 10 seconds: `sleep(10*SECOND)`. |=== @@ -170,7 +170,7 @@ Usage: [source,bash] ---- -clc script [path/location] [flags] -- [parameter, ...] +clc script run [path/location] [flags] -- [parameter, ...] ---- Parameters: From 4773b6875f4590475d27f7a130ac0fc1fdc66c85 Mon Sep 17 00:00:00 2001 From: Yuce Tekol Date: Thu, 11 Jan 2024 14:49:29 +0300 Subject: [PATCH 6/8] Update --- docs/modules/ROOT/pages/clc-script.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/modules/ROOT/pages/clc-script.adoc b/docs/modules/ROOT/pages/clc-script.adoc index 94afe04..744d787 100644 --- a/docs/modules/ROOT/pages/clc-script.adoc +++ b/docs/modules/ROOT/pages/clc-script.adoc @@ -1,4 +1,4 @@ -= clc script += clc script run :description: Runs the script in the given local or HTTP location. Advanced script currently only supports local files. {description} From 2abc5d34626d8e6a8e69250ca107f077c31bd8df Mon Sep 17 00:00:00 2001 From: Yuce Tekol Date: Thu, 11 Jan 2024 15:15:53 +0300 Subject: [PATCH 7/8] Review comments --- docs/modules/ROOT/pages/advanced-scripting.adoc | 2 +- docs/modules/ROOT/pages/clc-atomicreference.adoc | 2 +- docs/modules/ROOT/pages/clc-serializer.adoc | 12 ++++++------ docs/modules/ROOT/pages/configuration.adoc | 4 ++-- docs/modules/ROOT/pages/overview.adoc | 10 +++++----- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/docs/modules/ROOT/pages/advanced-scripting.adoc b/docs/modules/ROOT/pages/advanced-scripting.adoc index e4a526b..c0de684 100644 --- a/docs/modules/ROOT/pages/advanced-scripting.adoc +++ b/docs/modules/ROOT/pages/advanced-scripting.adoc @@ -676,7 +676,7 @@ Whenever an error occurs, CLC stops the script and prints an error message. This is usually the safest way to handle the error. But there are times when you want to try something that can result in an error, and handle it without giving back the control. -The `script` command supports the `--ignore-errors` flag which suppresses errors while running the script. +The `script run` command supports the `--ignore-errors` flag, which suppresses errors while running the script. You can use the `last_error()` function to get the error so you can act on it. Let's demonstrate that with an example using the `decode_data` function. diff --git a/docs/modules/ROOT/pages/clc-atomicreference.adoc b/docs/modules/ROOT/pages/clc-atomicreference.adoc index 43f1652..8d80f95 100644 --- a/docs/modules/ROOT/pages/clc-atomicreference.adoc +++ b/docs/modules/ROOT/pages/clc-atomicreference.adoc @@ -221,7 +221,7 @@ clc atomicreference --name ref1 get my-value == clc atomicreference get-and-set -Sets a value in the given AtomicReference and returns the old value. +Sets a value in the given AtomicReference and returns the previous value. Usage: diff --git a/docs/modules/ROOT/pages/clc-serializer.adoc b/docs/modules/ROOT/pages/clc-serializer.adoc index faf1c54..44c6b19 100644 --- a/docs/modules/ROOT/pages/clc-serializer.adoc +++ b/docs/modules/ROOT/pages/clc-serializer.adoc @@ -1,6 +1,6 @@ = clc serializer (Beta) -Generates serializer code for various serialization systems. +Generates serialization code. Usage: @@ -65,7 +65,7 @@ A schema allows you to: Schemas are written in YAML. -Schema format is given below: +The schema format is as follows: [source,yaml] ---- @@ -88,18 +88,18 @@ The options apply to all serializer classes generated from the classes in this f ==== classes -Defines class informations in the schema. +Defines class information in the schema. All class informations have the following attributes: * `name`: Full name of the class, including package/namespace. -* `typename`: This is an optional type name to be used. Compact serialization mechanism distinguishes data types in the cluster using their type names. Hence, type names must be unique across the cluster. If not specified, the full type name of the class is used. -* `fields`: Field informations of the class +* `typename`: This is an optional type name to be used. The compact serialization mechanism distinguishes data types in the cluster using their type names. This means that type names must be unique across the cluster. If not specified, the full type name of the class is used. +* `fields`: Field information of the class A field information has the following attributes: * `name`: Name of the field -* `type`: EIther one of the builtin type names llsted below, or full name of the field type, including package/namespace. +* `type`: Either one of the built0in type names listed below, or the full name of the field type, including the package/namespace. ==== Builtin types: diff --git a/docs/modules/ROOT/pages/configuration.adoc b/docs/modules/ROOT/pages/configuration.adoc index 272fba5..9190455 100644 --- a/docs/modules/ROOT/pages/configuration.adoc +++ b/docs/modules/ROOT/pages/configuration.adoc @@ -34,8 +34,8 @@ pr-3066 $ clc -c pr-3066 ---- -. If no configuration is specified, and there is a single configuration, that configuration is used. -. If there are more than one configurations and the `default` configuration exists, that is used. +. If no configuration is specified, but a single configuration exists, that configuration is used. +. If there are more than one configuration exists, and the `default` configuration exists, the `default` configuration is used. . Otherwise CLC displays a selector to choose the cluster. The name of the default configuration may be overriden using the `CLC_CONFIG` environment variable. diff --git a/docs/modules/ROOT/pages/overview.adoc b/docs/modules/ROOT/pages/overview.adoc index 2a0792a..cf88123 100644 --- a/docs/modules/ROOT/pages/overview.adoc +++ b/docs/modules/ROOT/pages/overview.adoc @@ -32,7 +32,7 @@ Get xref:clc-map.adoc[direct access to map data] for quick debugging of prototyp === Scripting for Automation -Write scripts execute repetitive administration, integration, or testing tasks. +Write scripts to execute repetitive administration, integration, or testing tasks. == Modes @@ -79,7 +79,7 @@ In the interactive mode, you can run SQL queries directly. Make sure to add a se --------------------------------------------------------------------------------- ---- -In order to run CLC commands, prefix them with a backslash (`\`): +To run CLC commands, prefix them with a backslash (`\`): ---- > \object list ------------------------------------ @@ -92,8 +92,8 @@ In order to run CLC commands, prefix them with a backslash (`\`): ------------------------------------ ---- -You can enter multiline CLC commands by adding a backslash (`\`) character at the very end of every line, except the last one. -The continuation lines are concatenated, so it may be necessary to put one or more spaces before the backslash: +You can enter multi-line CLC commands by adding a backslash (`\`) character at the very end of every line, except the last one. +The continuation lines are concatenated, so you might need to add one or more spaces before the backslash: ---- > \map --name \ ... set my-map \ @@ -111,7 +111,7 @@ If a value contains whitespace, you can wrap it with single or double quotes: ----------------------- ---- -Alternatively, you can escape space character with a backslash: +Alternatively, you can escape the space character with a backslash: ---- > \map --name my-map set key\ with\ whitespace value\ with\ whitespace > \map --name my-map entry-set From 42fe9beaa1c49bb95652100880bea35baa44869c Mon Sep 17 00:00:00 2001 From: Yuce Tekol Date: Thu, 11 Jan 2024 17:07:51 +0300 Subject: [PATCH 8/8] Review comments --- docs/modules/ROOT/pages/clc-serializer.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/modules/ROOT/pages/clc-serializer.adoc b/docs/modules/ROOT/pages/clc-serializer.adoc index 44c6b19..6371b30 100644 --- a/docs/modules/ROOT/pages/clc-serializer.adoc +++ b/docs/modules/ROOT/pages/clc-serializer.adoc @@ -99,7 +99,7 @@ All class informations have the following attributes: A field information has the following attributes: * `name`: Name of the field -* `type`: Either one of the built0in type names listed below, or the full name of the field type, including the package/namespace. +* `type`: Either one of the built-in type names listed below, or the full name of the field type, including the package/namespace. ==== Builtin types: