Specificatoins of Command Line Utilities of Kyoto Cabinet

Copyright (C) 2009-2012 FAL Labs
Last Update: Fri, 04 Mar 2011 23:07:26 -0800

This document describes how to use command line utilities. They are useful to manage database contents and to test the library and its applications.

  1. kcutiltest : to test the utility functions.
  2. kcutilmgr : miscellaneous utilities.
  3. kcprototest : to test the prototype database.
  4. kcstashtest : to test the stash database.
  5. kccachetest : to test the cache hash database.
  6. kcgrasstest : to test the cache tree database.
  7. kchashtest : to test the file hash database.
  8. kchashmgr : to manage the file hash database.
  9. kctreetest : to test the file tree database.
  10. kctreemgr : to manage the file tree database.
  11. kcdirtest : to test the directory hash database.
  12. kcdirmgr : to manage the directory hash database.
  13. kcforesttest : to test the directory tree database.
  14. kcforestmgr : to manage the directory tree database.
  15. kcpolytest : to test the polymorphic database.
  16. kcpolymgr : to manage the polymorphic database.
  17. kclangctest : to test the C language binding.

kcutiltest

The command `kcutiltest' is a utility for facility test and performance test of the utility functions. This command is used in the following format. `rnum' specifies the number of iterations. `path' specifies the path of a file.

kcutiltest mutex [-th num] [-iv num] rnum
Performs test of lock primitives.
kcutiltest cond [-th num] [-iv num] rnum
Performs test of condition variable primitives.
kcutiltest para [-th num] [-iv num] rnum
Performs test of parallel processing.
kcutiltest file [-th num] [-rnd] [-msiz num] path rnum
Performs test of the file system abstraction.
kcutiltest lhmap [-rnd] [-bnum num] rnum
Performs test of doubly-linked hash map.
kcutiltest thmap [-rnd] [-bnum num] rnum
Performs test of memory-saving hash map.
kcutiltest talist [-rnd] rnum
Performs test of memory-saving array list.
kcutiltest misc rnum
Performs test of miscellaneous mechanisms.

Options feature the following.

This command returns 0 on success, another on failure.


kcutilmgr

The command `kcutilmgr' is a tool of miscellaneous utilities, and to show the configuration. This command is used in the following format. `file' specifies a input file. If it is omitted, the standard input is read. If it begins with "@", the trailing substring is treated as the input. `pattern' specifies an matching pattern.

kcutilmgr hex [-d] [file]
Performs hexadecimal encoding and its decoding.
kcutilmgr enc [-hex|-url|-quote] [-d] [file]
Performs Base64 encoding and its decoding.
kcutilmgr ciph [-key str] [file]
Performs Arcfour cipher and its decipher.
kcutilmgr comp [-def|-gz|-lzo|-lzma] [-d] [file]
Performs ZLIB encoding and its decoding. By default, use the raw format.
kcutilmgr hash [-fnv|-path|-crc] [file]
Calculates the hash value. By default, use MurMur hashing.
kcutilmgr regex [-alt str] [-ic] pattern [file]
Prints lines matching a regular expression.
kcutilmgr conf [-v|-i|-l|-p]
Shows the configuration of Kyoto Cabinet.
kcutilmgr version
Shows the version information of Kyoto Cabinet.

Options feature the following.

This command returns 0 on success, another on failure.


kcprototest

The command `kcprototest' is a utility for facility test and performance test of the prototype database. This command is used in the following format. `rnum' specifies the number of iterations.

kcprototest order [-tree] [-th num] [-rnd] [-etc] [-tran] rnum
Performs in-order tests.
kcprototest queue [-tree] [-th num] [-it num] [-rnd] rnum
Performs queuing operations.
kcprototest wicked [-tree] [-th num] [-it num] rnum
Performs mixed operations selected at random.
kcprototest tran [-tree] [-th num] [-it num] rnum
Performs test of transaction.

Options feature the following.

This command returns 0 on success, another on failure.


kcstashtest

The command `kcstashtest' is a utility for facility test and performance test of the stash database. This command is used in the following format. `rnum' specifies the number of iterations.

kccachetest order [-th num] [-rnd] [-etc] [-tran] [-bnum num] [-lv] rnum
Performs in-order tests.
kccachetest queue [-th num] [-it num] [-rnd] [-bnum num] [-lv] rnum
Performs queuing operations.
kccachetest wicked [-th num] [-it num] [-bnum num] [-lv] rnum
Performs mixed operations selected at random.
kccachetest tran [-th num] [-it num] [-bnum num] [-lv] rnum
Performs test of transaction.

Options feature the following.

This command returns 0 on success, another on failure.


kccachetest

The command `kccachetest' is a utility for facility test and performance test of the cache hash database. This command is used in the following format. `rnum' specifies the number of iterations.

kccachetest order [-th num] [-rnd] [-etc] [-tran] [-tc] [-bnum num] [-capcnt num] [-capsiz num] [-lv] rnum
Performs in-order tests.
kccachetest queue [-th num] [-it num] [-rnd] [-tc] [-bnum num] [-capcnt num] [-capsiz num] [-lv] rnum
Performs queuing operations.
kccachetest wicked [-th num] [-it num] [-tc] [-bnum num] [-capcnt num] [-capsiz num] [-lv] rnum
Performs mixed operations selected at random.
kccachetest tran [-th num] [-it num] [-tc] [-bnum num] [-capcnt num] [-capsiz num] [-lv] rnum
Performs test of transaction.

Options feature the following.

This command returns 0 on success, another on failure.


kcgrasstest

The command `kcgrasstest' is a utility for facility test and performance test of the cache tree database. This command is used in the following format. `rnum' specifies the number of iterations.

kcgrasstest order [-th num] [-rnd] [-etc] [-tran] [-tc] [-bnum num] [-psiz num] [-pccap num] [-rcd|-rcld|-rcdd] [-lv] rnum
Performs in-order tests.
kcgrasstest queue [-th num] [-it num] [-rnd] [-tc] [-bnum num] [-psiz num] [-pccap num] [-rcd|-rcld|-rcdd] [-lv] rnum
Performs queuing operations.
kcgrasstest wicked [-th num] [-it num] [-tc] [-bnum num] [-psiz num] [-pccap num] [-rcd|-rcld|-rcdd] [-lv] rnum
Performs mixed operations selected at random.
kcgrasstest tran [-th num] [-it num] [-tc] [-bnum num] [-psiz num] [-pccap num] [-rcd|-rcld|-rcdd] [-lv] rnum
Performs test of transaction.

Options feature the following.

This command returns 0 on success, another on failure.


kchashtest

The command `kchashtest' is a utility for facility test and performance test of the file hash database. This command is used in the following format. `path' specifies the path of a database file. `rnum' specifies the number of iterations.

kchashtest order [-th num] [-rnd] [-set|-get|-getw|-rem|-etc] [-tran] [-oat|-oas|-onl|-onl|-otl|-onr] [-apow num] [-fpow num] [-ts] [-tl] [-tc] [-bnum num] [-msiz num] [-dfunit num] [-lv] path rnum
Performs in-order tests.
kchashtest queue [-th num] [-it num] [-rnd] [-oat|-oas|-onl|-onl|-otl|-onr] [-apow num] [-fpow num] [-ts] [-tl] [-tc] [-bnum num] [-msiz num] [-dfunit num] [-lv] path rnum
Performs queuing operations.
kchashtest wicked [-th num] [-it num] [-oat|-oas|-onl|-onl|-otl|-onr] [-apow num] [-fpow num] [-ts] [-tl] [-tc] [-bnum num] [-msiz num] [-dfunit num] [-lv] path rnum
Performs mixed operations selected at random.
kchashtest tran [-th num] [-it num] [-hard] [-oat|-oas|-onl|-onl|-otl|-onr] [-apow num] [-fpow num] [-ts] [-tl] [-tc] [-bnum num] [-msiz num] [-dfunit num] [-lv] path rnum
Performs test of transaction.

Options feature the following.

This command returns 0 on success, another on failure.


kchashmgr

The command `kchashmgr' is a utility for test and debugging of the file hash database and its applications. `path' specifies the path of a database file. `key' specifies the key of a record. `value' specifies the value of a record. `file' specifies the input/output file.

kchashmgr create [-otr] [-onl|-otl|-onr] [-apow num] [-fpow num] [-ts] [-tl] [-tc] [-bnum num] path
Creates a database file.
kchashmgr inform [-onl|-otl|-onr] [-st] path
Prints status information.
kchashmgr set [-onl|-otl|-onr] [-add|-app|-rep|-inci|-incd] [-sx] path key value
Stores a record.
kchashmgr remove [-onl|-otl|-onr] [-sx] path key
Removes a record.
kchashmgr get [-onl|-otl|-onr] [-rm] [-sx] [-px] [-pz] path key
Prints the value of a record.
kchashmgr list [-onl|-otl|-onr] [-max num] [-rm] [-sx] [-pv] [-px] path [key]
Prints keys of all records, separated by line feeds.
kchashmgr clear [-onl|-otl|-onr] path
Removes all records of a database.
kchashmgr import [-onl|-otl|-onr] [-sx] path [file]
Imports records from a TSV file.
kchashmgr copy [-onl|-otl|-onr] path file
Copies the whole database.
kchashmgr dump [-onl|-otl|-onr] path [file]
Dumps records into a snapshot file.
kchashmgr load [-otr] [-onl|-otl|-onr] path [file]
Loads records from a snapshot file.
kchashmgr defrag [-onl|-otl|-onr] path
Performs defragmentation.
kchashmgr setbulk [-onl|-otl|-onr] path key value ...
Store records at once.
kchashmgr removebulk [-onl|-otl|-onr] [-sx] path key ...
Remove records at once.
kchashmgr getbulk [-onl|-otl|-onr] [-sx] [-px] path key ...
Retrieve records at once.
kchashmgr check [-onl|-otl|-onr] path
Checks consistency.

Options feature the following.

This command returns 0 on success, another on failure.


kctreetest

The command `kctreetest' is a utility for facility test and performance test of the file tree database. This command is used in the following format. `path' specifies the path of a database file. `rnum' specifies the number of iterations.

kctreetest order [-th num] [-rnd] [-set|-get|-getw|-rem|-etc] [-tran] [-oat|-oas|-onl|-onl|-otl|-onr] [-apow num] [-fpow num] [-ts] [-tl] [-tc] [-bnum num] [-psiz num] [-msiz num] [-dfunit num] [-pccap num] [-rcd|-rcld|-rcdd] [-lv] path rnum
Performs in-order tests.
kctreetest queue [-th num] [-it num] [-rnd] [-oat|-oas|-onl|-onl|-otl|-onr] [-apow num] [-fpow num] [-ts] [-tl] [-tc] [-bnum num] [-psiz num] [-msiz num] [-dfunit num] [-pccap num] [-rcd|-rcld|-rcdd] [-lv] path rnum
Performs queuing operations.
kctreetest wicked [-th num] [-it num] [-oat|-oas|-onl|-onl|-otl|-onr] [-apow num] [-fpow num] [-ts] [-tl] [-tc] [-bnum num] [-psiz num] [-msiz num] [-dfunit num] [-pccap num] [-rcd|-rcld|-rcdd] [-lv] path rnum
Performs mixed operations selected at random.
kctreetest tran [-th num] [-it num] [-hard] [-oat|-oas|-onl|-onl|-otl|-onr] [-apow num] [-fpow num] [-ts] [-tl] [-tc] [-bnum num] [-psiz num] [-msiz num] [-dfunit num] [-pccap num] [-rcd|-rcld|-rcdd] [-lv] path rnum
Performs test of transaction.

Options feature the following.

This command returns 0 on success, another on failure.


kctreemgr

The command `kctreemgr' is a utility for test and debugging of the file tree database and its applications. `path' specifies the path of a database file. `key' specifies the key of a record. `value' specifies the value of a record. `file' specifies the input/output file.

kctreemgr create [-otr] [-onl|-otl|-onr] [-apow num] [-fpow num] [-ts] [-tl] [-tc] [-bnum num] [-psiz num] [-rcd|-rcld|-rcdd] path
Creates a database file.
kctreemgr inform [-onl|-otl|-onr] [-st] path
Prints status information.
kctreemgr set [-onl|-otl|-onr] [-add|-app|-rep|-inci|-incd] [-sx] path key value
Stores a record.
kctreemgr remove [-onl|-otl|-onr] [-sx] path key
Removes a record.
kctreemgr get [-onl|-otl|-onr] [-rm] [-sx] [-px] [-pz] path key
Prints the value of a record.
kctreemgr list [-onl|-otl|-onr] [-des] [-max num] [-rm] [-sx] [-pv] [-px] path [key]
Prints keys of all records, separated by line feeds.
kctreemgr clear [-onl|-otl|-onr] path
Removes all records of a database.
kctreemgr import [-onl|-otl|-onr] [-sx] path [file]
Imports records from a TSV file.
kctreemgr copy [-onl|-otl|-onr] path file
Copies the whole database.
kctreemgr dump [-onl|-otl|-onr] path [file]
Dumps records into a snapshot file.
kctreemgr load [-otr] [-onl|-otl|-onr] path [file]
Loads records from a snapshot file.
kctreemgr defrag [-onl|-otl|-onr] path
Performs defragmentation.
kctreemgr setbulk [-onl|-otl|-onr] path key value ...
Store records at once.
kctreemgr removebulk [-onl|-otl|-onr] [-sx] path key ...
Remove records at once.
kctreemgr getbulk [-onl|-otl|-onr] [-sx] [-px] path key ...
Retrieve records at once.
kctreemgr check [-onl|-otl|-onr] path
Checks consistency.

Options feature the following.

This command returns 0 on success, another on failure.


kcdirtest

The command `kcdirtest' is a utility for facility test and performance test of the directory hash database. This command is used in the following format. `path' specifies the path of a database file. `rnum' specifies the number of iterations.

kcdirtest order [-th num] [-rnd] [-set|-get|-getw|-rem|-etc] [-tran] [-oat|-oas|-onl|-onl|-otl|-onr] [-tc] [-lv] path rnum
Performs in-order tests.
kcdirtest queue [-th num] [-it num] [-rnd] [-oat|-oas|-onl|-onl|-otl|-onr] [-tc] [-lv] path rnum
Performs queuing operations.
kcdirtest wicked [-th num] [-it num] [-oat|-oas|-onl|-onl|-otl|-onr] [-tc] [-lv] path rnum
Performs mixed operations selected at random.
kcdirtest tran [-th num] [-it num] [-hard] [-oat|-oas|-onl|-onl|-otl|-onr] [-tc] [-lv] path rnum
Performs test of transaction.

Options feature the following.

This command returns 0 on success, another on failure.


kcdirmgr

The command `kcdirmgr' is a utility for test and debugging of the directory hash database and its applications. `path' specifies the path of a database file. `key' specifies the key of a record. `value' specifies the value of a record. `file' specifies the input/output file.

kcdirmgr create [-otr] [-onl|-otl|-onr] [-tc] path
Creates a database file.
kcdirmgr inform [-onl|-otl|-onr] [-st] path
Prints status information.
kcdirmgr set [-onl|-otl|-onr] [-add|-app|-rep|-inci|-incd] [-sx] path key value
Stores a record.
kcdirmgr remove [-onl|-otl|-onr] [-sx] path key
Removes a record.
kcdirmgr get [-onl|-otl|-onr] [-rm] [-sx] [-px] [-pz] path key
Prints the value of a record.
kcdirmgr list [-onl|-otl|-onr] [-max num] [-rm] [-sx] [-pv] [-px] path [key]
Prints keys of all records, separated by line feeds.
kcdirmgr clear [-onl|-otl|-onr] path
Removes all records of a database.
kcdirmgr import [-onl|-otl|-onr] [-sx] path [file]
Imports records from a TSV file.
kcdirmgr copy [-onl|-otl|-onr] path file
Copies the whole database.
kcdirmgr dump [-onl|-otl|-onr] path [file]
Dumps records into a snapshot file.
kcdirmgr load [-otr] [-onl|-otl|-onr] path [file]
Loads records from a snapshot file.
kcdirmgr defrag [-onl|-otl|-onr] path
Performs defragmentation.
kcdirmgr setbulk [-onl|-otl|-onr] path key value ...
Store records at once.
kcdirmgr removebulk [-onl|-otl|-onr] [-sx] path key ...
Remove records at once.
kcdirmgr getbulk [-onl|-otl|-onr] [-sx] [-px] path key ...
Retrieve records at once.
kcdirmgr check [-onl|-otl|-onr] path
Checks consistency.

Options feature the following.

This command returns 0 on success, another on failure.


kcforesttest

The command `kcforesttest' is a utility for facility test and performance test of the directory tree database. This command is used in the following format. `path' specifies the path of a database file. `rnum' specifies the number of iterations.

kcforesttest order [-th num] [-rnd] [-set|-get|-getw|-rem|-etc] [-tran] [-oat|-oas|-onl|-onl|-otl|-onr] [-tc] [-bnum num] [-psiz num] [-pccap num] [-rcd|-rcld|-rcdd] [-lv] path rnum
Performs in-order tests.
kcforesttest queue [-th num] [-it num] [-rnd] [-oat|-oas|-onl|-onl|-otl|-onr] [-tc] [-bnum num] [-psiz num] [-pccap num] [-rcd|-rcld|-rcdd] [-lv] path rnum
Performs queuing operations.
kcforesttest wicked [-th num] [-it num] [-oat|-oas|-onl|-onl|-otl|-onr] [-tc] [-bnum num] [-psiz num] [-pccap num] [-rcd|-rcld|-rcdd] [-lv] path rnum
Performs mixed operations selected at random.
kcforesttest tran [-th num] [-it num] [-hard] [-oat|-oas|-onl|-onl|-otl|-onr] [-tc] [-bnum num] [-psiz num] [-pccap num] [-rcd|-rcld|-rcdd] [-lv] path rnum
Performs test of transaction.

Options feature the following.

This command returns 0 on success, another on failure.


kcforestmgr

The command `kcforestmgr' is a utility for test and debugging of the file tree database and its applications. `path' specifies the path of a database file. `key' specifies the key of a record. `value' specifies the value of a record. `file' specifies the input/output file.

kcforestmgr create [-otr] [-onl|-otl|-onr] [-tc] [-bnum num] [-psiz num] [-rcd|-rcld|-rcdd] path
Creates a database file.
kcforestmgr inform [-onl|-otl|-onr] [-st] path
Prints status information.
kcforestmgr set [-onl|-otl|-onr] [-add|-app|-rep|-inci|-incd] [-sx] path key value
Stores a record.
kcforestmgr remove [-onl|-otl|-onr] [-sx] path key
Removes a record.
kcforestmgr get [-onl|-otl|-onr] [-rm] [-sx] [-px] [-pz] path key
Prints the value of a record.
kcforestmgr list [-onl|-otl|-onr] [-des] [-max num] [-rm] [-sx] [-pv] [-px] path [key]
Prints keys of all records, separated by line feeds.
kcforestmgr clear [-onl|-otl|-onr] path
Removes all records of a database.
kcforestmgr import [-onl|-otl|-onr] [-sx] path [file]
Imports records from a TSV file.
kcforestmgr copy [-onl|-otl|-onr] path file
Copies the whole database.
kcforestmgr dump [-onl|-otl|-onr] path [file]
Dumps records into a snapshot file.
kcforestmgr load [-otr] [-onl|-otl|-onr] path [file]
Loads records from a snapshot file.
kcforestmgr setbulk [-onl|-otl|-onr] path key value ...
Store records at once.
kcforestmgr removebulk [-onl|-otl|-onr] [-sx] path key ...
Remove records at once.
kcforestmgr getbulk [-onl|-otl|-onr] [-sx] [-px] path key ...
Retrieve records at once.
kcforestmgr check [-onl|-otl|-onr] path
Checks consistency.

Options feature the following.

This command returns 0 on success, another on failure.


kcpolytest

The command `kcpolytest' is a utility for facility test and performance test of the polymorphic database. This command is used in the following format. `path' specifies the path of a database file. `rnum' specifies the number of iterations.

kcpolytest order [-th num] [-rnd] [-set|-get|-getw|-rem|-etc] [-tran] [-oat|-oas|-onl|-onl|-otl|-onr] [-lv] path rnum
Performs in-order tests.
kcpolytest queue [-th num] [-it num] [-rnd] [-oat|-oas|-onl|-onl|-otl|-onr] [-lv] path rnum
Performs queuing operations.
kcpolytest wicked [-th num] [-it num] [-oat|-oas|-onl|-onl|-otl|-onr] [-lv] path rnum
Performs mixed operations selected at random.
kcpolytest tran [-th num] [-it num] [-hard] [-oat|-oas|-onl|-onl|-otl|-onr] [-lv] path rnum
Performs test of transaction.
kcpolytest mapred [-rnd] [-ru] [-oat|-oas|-onl|-onl|-otl|-onr] [-lv] [-tmp str] [-dbnum num] [-clim num] [-cbnum num] [-xnl] [-xpm] [-xpr] [-xpf] [-xnc] path rnum
Performs MapReduce operations.
kcpolytest index [-th num] [-rnd] [-set|-get|-rem|-etc] [-tran] [-oat|-oas|-onl|-onl|-otl|-onr] [-lv] path rnum
Performs indexing operations.
kcpolytest misc path
Performs miscellaneous tests.

Options feature the following.

This command returns 0 on success, another on failure.


kcpolymgr

The command `kcpolymgr' is a utility for test and debugging of the polymorphic database and its applications. `path' specifies the path of a database file. `key' specifies the key of a record. `value' specifies the value of a record. `file' specifies the input/output file. `src' specifies other database files.

kcpolymgr create [-otr] [-onl|-otl|-onr] path
Creates a database file.
kcpolymgr inform [-onl|-otl|-onr] [-st] path
Prints status information.
kcpolymgr set [-onl|-otl|-onr] [-add|-app|-rep|-inci|-incd] [-sx] path key value
Stores a record.
kcpolymgr remove [-onl|-otl|-onr] [-sx] path key
Removes a record.
kcpolymgr get [-onl|-otl|-onr] [-rm] [-sx] [-px] [-pz] path key
Prints the value of a record.
kcpolymgr list [-onl|-otl|-onr] [-mp|-mr|-ms] [-des] [-max num] [-rm] [-sx] [-pv] [-px] path [key]
Prints keys of all records, separated by line feeds.
kcpolymgr clear [-onl|-otl|-onr] path
Removes all records of a database.
kcpolymgr import [-onl|-otl|-onr] [-sx] path [file]
Imports records from a TSV file.
kcpolymgr copy [-onl|-otl|-onr] path file
Copies the whole database.
kcpolymgr dump [-onl|-otl|-onr] path [file]
Dumps records into a snapshot file.
kcpolymgr load [-otr] [-onl|-otl|-onr] path [file]
Loads records from a snapshot file.
kcpolymgr merge [-onl|-otl|-onr] [-add|-app|-rep] path src...
Merge records from other databases.
kcpolymgr setbulk [-onl|-otl|-onr] path key value ...
Store records at once.
kcpolymgr removebulk [-onl|-otl|-onr] [-sx] path key ...
Remove records at once.
kcpolymgr getbulk [-onl|-otl|-onr] [-sx] [-px] path key ...
Retrieve records at once.
kcpolymgr check [-onl|-otl|-onr] path
Checks consistency.

Options feature the following.

This command returns 0 on success, another on failure.


kclangctest

The command `kclangctest' is a utility for facility test and performance test of the C language binding. This command is used in the following format. `path' specifies the path of a database file. `rnum' specifies the number of iterations.

kclangctest order [-rnd] [-etc] [-tran] [-oat|-oas|-onl|-otl|-onr] path rnum
Performs in-order tests.
kclangctest index [-rnd] [-etc] [-oat|-oas|-onl|-otl|-onr] path rnum
Performs indexing operations.
kclangctest map [-rnd] [-etc] [-bnum num] rnum
Performs test of memory-saving hash map.
kclangctest list [-rnd] [-etc] rnum
Performs test of memory-saving array list.

Options feature the following.

This command returns 0 on success, another on failure.