K2hdkc class
K2hdkc class provides methods to handle k2hdkc cluster.
Class summary
class K2hdkc {
private string $_config_file;
private int $_port;
private string $_cuk;
private bool $_rejoin;
private bool $_rejoin_forever;
private bool $_clear_backup;
/** @var resource|null */
private $_handle;
public function __construct(
string $config_file,
int $port = 8031,
string $cuk = null,
bool $rejoin = true,
bool $rejoin_forever = true,
bool $clear_backup = true) {}
public function __destruct() {}
public function setValue(
string $key,
string $val,
bool $clear_subkeys = false,
array $subkeys = null,
string $password = null,
int $expiration_duration = 0): bool {}
public function getValue(
string $key,
string $password = null): string|null {}
public function addSubkey(
string $key,
string $subkey,
string $subval,
bool $check_attr = true,
string $password = null,
int $expiration_duration = 0): bool {}
public function casGet(
string $key,
string $password = null): int|false {}
public function casDecrement(
string $key,
string $password = null,
int $expiration_duration = 0): bool {}
public function casIncrement(
string $key,
string $password = null,
int $expiration_duration = 0): bool {}
public function casInit(
string $key,
int $val,
string $password = null,
int $expiration_duration = 0): bool {}
public function casSet(
string $key,
int $old_val,
int $new_val,
string $password = null,
int $expiration_duration = 0): bool {}
public function clearSubkeys(
string $key): bool {}
public function close(): bool {}
public function getAttrs(
string $key): array|null {}
public function getSubkeys(
string $key): array|null {}
public function queueGet(
string $prefix,
bool $is_fifo = true,
string $password = null): string|null {}
public function queuePut(
string $prefix,
string $val,
bool $is_fifo = true,
bool $is_check_attr = true,
string $password = null,
int $expiration_duration = 0): bool {}
public function keyQueueGet(
string $prefix,
bool $is_fifo = true,
string $password = null): array|false {}
public function keyQueuePut(
string $prefix,
string $key,
string $val,
bool $is_fifo = true,
bool $is_check_attr = true,
string $password = null,
int $expiration_duration = 0): bool {}
public function remove(
string $key,
string $password = null): bool {}
public function removeSubkeys(
string $key,
array $subkeys,
bool $nested = false): bool {}
public function rename(
string $key,
string $new_key,
string $parent_key = null,
bool $is_check_attr = true,
string $password = null,
int $expiration_duration = 0): bool {}
public function setSubkeys(
string $key,
array $subkeys): bool {}
}
Methods
- K2hdkc::__construct - Creates a K2hdkc instance
- K2hdkc::__destruct - Destructs a K2hdkc instance
- K2hdkc::setValue - Sets a pair of the key/value
- K2hdkc::getValue - Gets a value of the key
- K2hdkc::addSubkey - Adds a subkey to the key
- K2hdkc::casGet - Gets a value using CAS operation
- K2hdkc::casDecrement - Decrements a value using CAS operation
- K2hdkc::casIncrement - Increments a value using CAS operation
- K2hdkc::casInit - Initializes a value using CAS operation
- K2hdkc::casSet - Sets a value using CAS operation
- K2hdkc::clearSubkeys - Removes all subkeys of the key
- K2hdkc::close - Closes a connection with the K2hdkc cluster
- K2hdkc::getAttrs - Gets attribute information of the key
- K2hdkc::getSubkeys - Gets all subkeys of the key
- K2hdkc::queueGet - Gets a value from the queue
- K2hdkc::queuePut - Puts a value to the queue
- K2hdkc::keyQueueGet - Gets a pair of the key/value from the queue
- K2hdkc::keyQueuePut - Puts a pair of the key/value from the queue
- K2hdkc::remove - Removes a pair of the key/value
- K2hdkc::removeSubkeys - Removes subkeys
- K2hdkc::rename - Renames a key
- K2hdkc::setSubkeys - Sets subkeys of the key