Skip to main content
Version: 5.7.1

clc map

Map commands are a group of map operations.

Usage:

bash
clc map [command] [flags]

Commands​

clc map clear​

Removes all entries from the map.

Usage:

bash
clc map clear [flags]

Parameters:

ParameterRequiredDescriptionDefault
--name, -nOptionalName of the map.default

clc map get​

Prints a single entry from the map as a key-value pair.

Usage:

bash
clc map get [key] [flags]

Parameters:

ParameterRequiredDescriptionDefault
--name, -nOptionalName of the map.default
keyRequiredKey of the map entry.N/A
--key-type, -kOptionalData type of the key. One of: string, bool, json, i8, i16, i32, i64, f32, f64.string
--format, -fOptional

Output format. Supported formats:

  • csv
  • delimited
  • json
  • table
delimited in non-interactive mode, table in interactive mode.

Example:

bash
clc map get --name yearbook 2012 --key-type i16

clc map set​

Sets the given key-value entry pair in a map.

Usage:

bash
clc map set [key] [value] [flags]

Parameters:

ParameterRequiredDescriptionDefault
--name, -nOptionalName of the map.default
keyRequiredKey of the map entry.N/A
value,RequiredValue to set for the key.N/A
--key-type, -kOptionalData type of the key. One of: string, bool, json, i8, i16, i32, i64, f32, f64string
--value-type, -vOptionalData type of the value. One of: string, bool, json, i8, i16, i32, i64, f32, f64string
--ttlOptionalDuration in milliseconds after which the entry will expire and be evicted. It cannot be shorter than 1 second (1000 ms).N/A
--max-idleOptionalMaximum time for this entry to stay idle in the map. It cannot be shorter than 1 second (1000 ms).N/A

Example:

bash
clc map set --key-type string hello --value-type f32 19.94 --name myMap --ttl 1300

clc map entry-set​

Gets all the entries of the specified map.

Usage:

bash
clc map entry-set [flags]

Parameters:

ParameterRequiredDescriptionDefault
--name, -nOptionalName of the map.default
--format, -fOptional

Output format. Supported formats:

  • csv
  • delimited
  • json
  • table
delimited in non-interactive mode, table in interactive mode.

Example:

bash
clc map entry-set -n myMap

clc map entry-view​

Returns a view of the entry with the given key.

This command doesn't affect entry statistics, such as Hits and entry metadata such as Max Idle.

See this documentation for information about per-entry statistics: Getting Statistics about a Specific Map Entry.

The following information about the entry is returned:

  • Key
  • Value
  • Cost
  • Creation Time
  • Expiration Time
  • Hits
  • Last Access Time
  • Last Stored Time
  • Last Update Time
  • Version
  • TTL
  • Max Idle

Usage:

bash
clc map entry-view [key] [flags]

Parameters:

ParameterRequiredDescriptionDefault
--name, -nOptionalName of the map.default
keyRequiredKey of the map entry.N/A
--key-type, -kOptionalData type of the key. One of: string, bool, json, i8, i16, i32, i64, f32, f64string

Example:

bash
clc map entry-view -n my-map my-key

clc map key-set​

Gets all the keys of the specified map.

Usage:

bash
clc map key-set [flags]

Parameters:

ParameterRequiredDescriptionDefault
--name, -nOptionalName of the map.default
--format, -fOptional

Output format. Supported formats:

  • csv
  • delimited
  • json
  • table
delimited in non-interactive mode, table in interactive mode.

Example:

bash
clc map key-set -n myMap

clc map values​

Gets all the values of the given map.

Usage:

bash
clc map values [flags]

Parameters:

ParameterRequiredDescriptionDefault
--name, -nOptionalName of the map.default
--format, -fOptional

Output format. Supported formats:

  • csv
  • delimited
  • json
  • table
delimited in non-interactive mode, table in interactive mode.

Example:

bash
clc map values -n myMap

clc map lock​

Locks the key of the given the map.

This command is only available in the interactive mode.

Usage:

bash
clc map lock [key] [flags]

Parameters:

ParameterRequiredDescriptionDefault
--name, -nOptionalName of the map.default
keyRequiredKey of the map entry.N/A
--key-type, -kOptionalData type of the key. One of: string, bool, json, i8, i16, i32, i64, f32, f64String

|--ttl |Optional |Duration in milliseconds after which the lock will expire. |-1

Example:

bash
clc map lock -n my-map --key-type string key1

clc map try-lock​

Tries to lock the key of the given the map. Returns a result without waiting.

This command is only available in the interactive mode.

Usage:

bash
clc map try-lock [key] [flags]

Parameters:

ParameterRequiredDescriptionDefault
--name, -nOptionalName of the map.default
keyRequiredKey of the map entry.N/A
--key-type, -kOptionalData type of the key. One of: string, bool, json, i8, i16, i32, i64, f32, f64String
--ttlOptionalDuration in milliseconds after which the lock will expire.-1

Example:

bash
clc map try-lock -n my-map --key-type string key1

clc map unlock​

Unlocks the key of the given the map.

This command is only available in the interactive mode.

Usage:

bash
clc map unlock [key] [flags]

Parameters:

ParameterRequiredDescriptionDefault
--name, -nOptionalName of the map.default
keyRequiredKey of the map entry.N/A
--key-type, -kOptionalData type of the key. One of: string, bool, json, i8, i16, i32, i64, f32, f64String

Example:

bash
clc map unlock -n my-map --key-type string key1

clc map size​

Prints the size of the given the map.

Usage:

bash
clc map size [flags]

Parameters:

ParameterRequiredDescriptionDefault
--name, -nOptionalName of the map.default

clc map load-all​

Load keys from map-store into the map. If no key is given, all keys are loaded.

Usage:

bash
clc map load-all [keys] [flags]

Parameters:

ParameterRequiredDescriptionDefault
--name, -nOptionalName of the map.default
keysRequiredKeys of the map entries.N/A
--key-type, -kOptionalData type of the key. One of: string, bool, json, i8, i16, i32, i64, f32, f64string

Example:

bash
clc map load-all --key-type string key1 key2 --name myMap --replace

clc map remove​

Deletes the value of a given key in a map and returns the key.

Usage:

bash
clc map remove [flags] [key]

Parameters:

ParameterRequiredDescriptionDefault
--name, -nOptionalName of the map.default
keyRequiredKey of the map entry.N/A
--key-type, -kOptionalData type of the key. One of: string, bool, json, i8, i16, i32, i64, f32, f64string
--format, -fOptional

Output format. Supported formats:

  • csv
  • delimited
  • json
  • table
delimited in non-interactive mode, table in interactive mode.

Example:

bash
clc map remove --name myMap --key-type string k1
k1

clc map destroy​

Deletes the map and all the data in it.

Usage:

bash
clc map destroy [flags]

Parameters:

ParameterRequiredDescriptionDefault
--name, -nOptionalName of the map.default
--yesOptionalSkip confirming the destroy operation.false