k2hdkc package

Submodules

k2hdkc.k2hdkc module

K2hdkc Python Driver

class k2hdkc.k2hdkc.K2hdkc(conf_file, port=8031, cuk=None, rejoin=True, rejoin_forever=True, clear_backup=True)

Bases: object

K2hdkc class provides methods to handle key/value pairs in k2hdkc hash database.

K2H_INVALID_HANDLE = 0
add_subkey(key, subkey, subval, check_attr=True, password=None, expire_duration=None, time_unit=TimeUnit.SECONDS)

Adds a new subkey to a current subkey.

cas_decrement(key, password=None, expire_duration=None)

Decrements a variable in a cluster by using a CAS operation.

cas_get(key, data_type, password=None, expire_duration=None)

Gets a variable from a cluster using a CAS operation.

cas_increment(key, password=None, expire_duration=None)

Increments a variable in a cluster by using a CAS operation.

cas_init(key, val=None, password=None, expire_duration=None)

Initializes a variable in a cluster by using a CAS operation.

cas_set(key, old_val, new_val, password=None, expire_duration=None)

Sets a value in a cluster by using a CAS operation.

clear_subkeys(key)

Clears subkeys of a key. Another subkeys that a subkey has will be removed recursively.

close()

Closes the handle

get(key, password=None)

Gets the value

get_attributes(key, use_str=True)

Retrievs attributes of a key.

get_subkeys(key, use_str=True)

Retrievs subkeys of a key.

keyqueue_get(prefix, is_fifo=True, password=None, expire_duration=None)

Gets a new key/value element from queue.

keyqueue_put(prefix, key, val, is_fifo=True, is_check_attr=True, password=None, expire_duration=None)

Adds a new key/value pair element to a queue.

property libc

returns libc handle

property libk2hdkc

returns libk2hkc handle

queue_get(prefix, is_fifo=True, password=None, expire_duration=None)

Gets a new element to a queue.

queue_put(prefix, val, is_fifo=True, is_check_attr=True, password=None, expire_duration=None)

Adds a new element to a queue.

remove(key)

Removes a key from a cluster.

remove_subkeys(key, subkeys, nested=False)

Removes a subkey from the current subkeys.

rename(key, newkey, parent_key=None, is_check_attr=True, password=None, expire_duration=None)

Renames a key in a cluster.

set(key, val, clear_subkeys=False, subkeys=None, password=None, expire_duration=None, time_unit=TimeUnit.SECONDS)

Sets a key/value pair

set_subkeys(key, subkeys)

Replaces current subkeys with new one.

Module contents

k2hdkc package

class k2hdkc.K2hdkc(conf_file, port=8031, cuk=None, rejoin=True, rejoin_forever=True, clear_backup=True)

Bases: object

K2hdkc class provides methods to handle key/value pairs in k2hdkc hash database.

K2H_INVALID_HANDLE = 0
add_subkey(key, subkey, subval, check_attr=True, password=None, expire_duration=None, time_unit=TimeUnit.SECONDS)

Adds a new subkey to a current subkey.

cas_decrement(key, password=None, expire_duration=None)

Decrements a variable in a cluster by using a CAS operation.

cas_get(key, data_type, password=None, expire_duration=None)

Gets a variable from a cluster using a CAS operation.

cas_increment(key, password=None, expire_duration=None)

Increments a variable in a cluster by using a CAS operation.

cas_init(key, val=None, password=None, expire_duration=None)

Initializes a variable in a cluster by using a CAS operation.

cas_set(key, old_val, new_val, password=None, expire_duration=None)

Sets a value in a cluster by using a CAS operation.

clear_subkeys(key)

Clears subkeys of a key. Another subkeys that a subkey has will be removed recursively.

close()

Closes the handle

get(key, password=None)

Gets the value

get_attributes(key, use_str=True)

Retrievs attributes of a key.

get_subkeys(key, use_str=True)

Retrievs subkeys of a key.

keyqueue_get(prefix, is_fifo=True, password=None, expire_duration=None)

Gets a new key/value element from queue.

keyqueue_put(prefix, key, val, is_fifo=True, is_check_attr=True, password=None, expire_duration=None)

Adds a new key/value pair element to a queue.

property libc

returns libc handle

property libk2hdkc

returns libk2hkc handle

queue_get(prefix, is_fifo=True, password=None, expire_duration=None)

Gets a new element to a queue.

queue_put(prefix, val, is_fifo=True, is_check_attr=True, password=None, expire_duration=None)

Adds a new element to a queue.

remove(key)

Removes a key from a cluster.

remove_subkeys(key, subkeys, nested=False)

Removes a subkey from the current subkeys.

rename(key, newkey, parent_key=None, is_check_attr=True, password=None, expire_duration=None)

Renames a key in a cluster.

set(key, val, clear_subkeys=False, subkeys=None, password=None, expire_duration=None, time_unit=TimeUnit.SECONDS)

Sets a key/value pair

set_subkeys(key, subkeys)

Replaces current subkeys with new one.