quasardb C API
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
Data Structures | Macros | Typedefs | Enumerations | Functions
client.h File Reference
#include "error.h"
#include <stddef.h>
#include <time.h>
#include <stdint.h>
#include "option.h"

Data Structures

struct  qdb_timespec_t
 A structure representing an elapsed time since epoch (cross-platform equivalent of timespec structure) More...
 
struct  qdb_remote_node_t
 A structure representing the address of a quasardb node. More...
 
struct  qdb_id_t
 A cluster-wide unique identifier. More...
 
struct  qdb_string_t
 A structure representing a character string of the given length. More...
 
struct  qdb_entry_metadata_t
 A structure representing the metadata of an entry in the database. More...
 
struct  qdb_compact_params_t
 The optional parameters for a compact operation. More...
 

Macros

#define qdb_never_expires   ((qdb_time_t)0u)
 An arbitrary time value representing the "no expiration" time value. More...
 
#define qdb_preserve_expiration   ((qdb_time_t)0xFFFFFFFFFFFFFFFFULL)
 An arbitrary time value representing the "preserve existing expiration" time value. More...
 

Typedefs

typedef long long qdb_time_t
 A cross-platform type that represents a time value. More...
 
typedef size_t qdb_size_t
 An alias for size_t.
 
typedef int64_t qdb_int_t
 A cross-platform type that represents a signed 64-bit integer.
 
typedef enum qdb_limits_t qdb_limits_t
 An enumeration of API limits.
 
typedef struct
qdb_handle_internal * 
qdb_handle_t
 An opaque handle to internal API-allocated structures needed for maintaining connection to a cluster.
 

Enumerations

enum  qdb_limits_t {
  qdb_l_max_alias_length = 1024, qdb_l_alias_max_length = qdb_l_max_alias_length, qdb_l_max_user_name_length = 120, qdb_max_user_name_length = qdb_l_max_user_name_length,
  qdb_l_max_property_length = 1024
}
 An enumeration of API limits. More...
 
enum  qdb_protocol_t { qdb_p_tcp = 0 }
 An enumeration of allowed network protocols. More...
 
enum  qdb_entry_type_t {
  qdb_entry_uninitialized = -1, qdb_entry_blob = 0, qdb_entry_integer = 1, qdb_entry_hset = 2,
  qdb_entry_tag = 3, qdb_entry_deque = 4, qdb_entry_stream = 5, qdb_entry_ts = 6,
  qdb_entry_double = 10, qdb_entry_timestamp = 11, qdb_entry_string = 12
}
 A enumeration representing possible entries type. More...
 
enum  qdb_compact_options_t { qdb_compact_full = 0, qdb_compact_piecewise = 1, qdb_compact_cf = 2, qdb_compact_prefix = 3 }
 An enumeration of compact options. More...
 

Functions

QDB_API_LINKAGE const char * qdb_version (void)
 Returns a null-terminated string describing the API version. More...
 
QDB_API_LINKAGE const char * qdb_build (void)
 Returns a null-terminated string describing the exact API build. More...
 
QDB_API_LINKAGE qdb_error_t qdb_open (qdb_handle_t *handle, qdb_protocol_t proto)
 Creates a qdb_handle_t. No connection will be established. More...
 
QDB_API_LINKAGE qdb_handle_t qdb_open_tcp (void)
 Creates a TCP/IP qdb_handle_t. No connection will be established. More...
 
QDB_API_LINKAGE qdb_error_t qdb_get_last_error (qdb_handle_t handle, qdb_error_t *error, qdb_string_t **message)
 Describes the last error code returned from the given handle. More...
 
QDB_API_LINKAGE qdb_error_t qdb_connect (qdb_handle_t handle, const char *uri)
 Binds the client instance to a quasardb cluster and connect to at least one node within. More...
 
QDB_API_LINKAGE qdb_error_t qdb_close (qdb_handle_t handle)
 Closes the handle previously opened with qdb_open or qdb_open_tcp. More...
 
QDB_API_LINKAGE qdb_error_t qdb_copy_alloc_buffer (qdb_handle_t handle, const void *source_buffer, qdb_size_t source_buffer_size, void **dest_buffer)
 Creates a clone of a buffer using API's high-performance memory allocator. More...
 
QDB_API_LINKAGE qdb_error_t qdb_alloc_buffer (qdb_handle_t handle, qdb_size_t buffer_size, void **dest_buffer)
 Allocates a buffer managed by the Quasar API. More...
 
QDB_API_LINKAGE void qdb_release (qdb_handle_t handle, const void *buffer)
 Releases an API-allocated buffer. More...
 
QDB_API_LINKAGE qdb_error_t qdb_remove (qdb_handle_t handle, const char *alias)
 Removes an entry from the cluster, regardless of its type. More...
 
QDB_API_LINKAGE qdb_error_t qdb_expires_at (qdb_handle_t handle, const char *alias, qdb_time_t expiry_time)
 Sets the absolute expiration time of an entry, if the type supports expiration. More...
 
QDB_API_LINKAGE qdb_error_t qdb_expires_from_now (qdb_handle_t handle, const char *alias, qdb_time_t expiry_delta)
 Sets the expiration time of an entry, relative to the current time of the client, if the type supports expiration. More...
 
QDB_API_LINKAGE qdb_error_t qdb_get_expiry_time (qdb_handle_t handle, const char *alias, qdb_time_t *expiry_time)
 Retrieves the absolute expiration time of the given entry. More...
 
QDB_API_LINKAGE qdb_error_t qdb_get_location (qdb_handle_t handle, const char *alias, qdb_remote_node_t *location)
 Returns the primary node of an entry. More...
 
QDB_API_LINKAGE qdb_error_t qdb_get_type (qdb_handle_t handle, const char *alias, qdb_entry_type_t *entry_type)
 Gets the type of an entry, if it exists. More...
 
QDB_API_LINKAGE qdb_error_t qdb_get_metadata (qdb_handle_t handle, const char *alias, qdb_entry_metadata_t *entry_metadata)
 Gets the meta-information about an entry, if it exists. More...
 
QDB_API_LINKAGE qdb_error_t qdb_get_metadata_by_id (qdb_handle_t handle, const qdb_id_t *reference, qdb_entry_metadata_t *entry_metadata)
 Gets the meta-information about an entry, if it exists. More...
 
QDB_API_LINKAGE qdb_error_t qdb_purge_all (qdb_handle_t handle, int timeout_ms)
 Removes irremediably all data from all the nodes of the cluster. More...
 
QDB_API_LINKAGE qdb_error_t qdb_trim_all (qdb_handle_t handle, int pause_ms, int timeout_ms)
 Trims all data on all the nodes of the cluster. More...
 
QDB_API_LINKAGE qdb_error_t qdb_trim_all_progress (qdb_handle_t handle, qdb_uint_t *run)
 Get the trimming process progress. More...
 
QDB_API_LINKAGE qdb_error_t qdb_abort_trim_all (qdb_handle_t handle)
 Abort the running trimming process. More...
 
QDB_API_LINKAGE qdb_error_t qdb_trim_entry (qdb_handle_t handle, const char *alias, qdb_uint_t *bytes_trimmed)
 Trims specific key. More...
 
QDB_API_LINKAGE qdb_error_t qdb_cluster_compact (qdb_handle_t handle, const qdb_compact_params_t *params)
 Compacts all data in the persistence layer on all the nodes of the cluster. More...
 
QDB_API_LINKAGE qdb_error_t qdb_cluster_get_compact_progress (qdb_handle_t handle, qdb_uint_t *run)
 Get the compaction process progress. More...
 
QDB_API_LINKAGE qdb_error_t qdb_cluster_abort_compact (qdb_handle_t handle)
 Abort the running compaction process. More...
 
QDB_API_LINKAGE qdb_error_t qdb_cluster_sync_with_master (qdb_handle_t handle)
 For the read only cluster call the synchronization with the master DB. More...
 
QDB_API_LINKAGE qdb_error_t qdb_cluster_get_sync_with_master_progress (qdb_handle_t handle, qdb_uint_t *run)
 For the read only cluster get the synchronization with the master DB process progress. More...
 
QDB_API_LINKAGE qdb_error_t qdb_purge_cache (qdb_handle_t handle, int timeout_ms)
 Removes all cached data from all the nodes of the cluster. More...
 
QDB_API_LINKAGE qdb_error_t qdb_wait_for_stabilization (qdb_handle_t handle, int timeout_ms)
 Wait for all nodes of the cluster to be stabilized. More...
 
QDB_API_LINKAGE qdb_error_t qdb_cluster_endpoints (qdb_handle_t handle, qdb_remote_node_t **endpoints, qdb_size_t *endpoints_count)
 Retrieve a sorted array of endpoints. More...
 
QDB_API_LINKAGE qdb_error_t qdb_cluster_reload_user_config (qdb_handle_t handle)
 Reload user configuration from file. More...