Feature TOP Build


After building K2HASH, you can check the operation by the following procedure.

1. Creating a usage environment

There are two ways to install K2HASH in your environment.
One is to download and install the package of K2HASH from packagecloud.io.
The other way is to build and install K2HASH from source code yourself.
These methods are described below.

Installing packages

The K2HASH publishes packages in packagecloud.io - AntPickax stable repository so that anyone can use it.
The package of the K2HASH is released in the form of Debian package, RPM package.
Since the installation method differs depending on your OS, please check the following procedure and install it.

Debian(Stretch) / Ubuntu(Bionic Beaver)

$ sudo apt-get update -y
$ sudo apt-get install curl -y
$ curl -s https://packagecloud.io/install/repositories/antpickax/stable/script.deb.sh | sudo bash
$ sudo apt-get install k2hash

To install the developer package, please install the following package.

$ sudo apt-get install k2hash-dev

Fedora28 / CentOS7.x(6.x)

$ sudo yum makecache
$ sudo yum install curl -y
$ curl -s https://packagecloud.io/install/repositories/antpickax/stable/script.rpm.sh | sudo bash
$ sudo yum install k2hash

To install the developer package, please install the following package.

$ sudo yum install k2hash-devel

Other OS

If you are not using the above OS, packages are not prepared and can not be installed directly.
In this case, build from the source code described below and install it.

Build and install from source code

For details on how to build and install K2HASH from source code, please see Build.

2. Run k2hlinetool

$ cd k2hash/tests
$ ./k2hlinetool -m

Run k2hlinetool with memory container for K2HASH

3. Storing value and print it manually

You can see interactive prompt by k2hlinetool after run it.
After that, you input k2hlinetool command to the prompt.

$ ./k2hlinetool -m
On memory mode
Attached paraemters:
    Full are mapping:                   true
    Key Index mask count:               8
    Collision Key Index mask count:     4
    Max element count:                  32
K2HTOOL> set mykey myvalue
K2HTOOL> print mykey
  +"mykey" => "myvalue"

4. Other testing and exiting

You can see interactive command list by “help” on prompt, and you can try to test those commands.
If you want to quit k2hlinetool, you can input “quit” on prompt.

Feature TOP Build