Loading...
Searching...
No Matches
Data Structures | Typedefs | Functions
as_cluster.h File Reference
#include <aerospike/as_atomic.h>
#include <aerospike/as_config.h>
#include <aerospike/as_metrics.h>
#include <aerospike/as_node.h>
#include <aerospike/as_partition.h>
#include <aerospike/as_policy.h>
#include <aerospike/as_thread_pool.h>
+ Include dependency graph for as_cluster.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  as_cluster
 
struct  as_event_state
 
struct  as_gc_item
 
struct  as_nodes
 

Typedefs

typedef void(* as_release_fn) (void *value)
 

Functions

static void as_cluster_add_delay_queue_timeout (as_cluster *cluster)
 
static void as_cluster_add_retries (as_cluster *cluster, uint32_t count)
 
static void as_cluster_add_retry (as_cluster *cluster)
 
AS_EXTERN void as_cluster_add_seed (as_cluster *cluster, const char *hostname, const char *tls_name, uint16_t port)
 
static void as_cluster_add_tran (as_cluster *cluster)
 
void as_cluster_change_password (as_cluster *cluster, const char *user, const char *password, const char *password_hash)
 
as_status as_cluster_create (as_config *config, as_error *err, as_cluster **cluster)
 
void as_cluster_destroy (as_cluster *cluster)
 
as_status as_cluster_disable_metrics (as_error *err, as_cluster *cluster)
 
as_status as_cluster_enable_metrics (as_error *err, as_cluster *cluster, as_metrics_policy *policy)
 
static uint64_t as_cluster_get_delay_queue_timeout_count (const as_cluster *cluster)
 
void as_cluster_get_node_names (as_cluster *cluster, int *n_nodes, char **node_names)
 
static uint64_t as_cluster_get_retry_count (const as_cluster *cluster)
 
static uint64_t as_cluster_get_tran_count (const as_cluster *cluster)
 
bool as_cluster_is_connected (as_cluster *cluster)
 
static void as_cluster_release_all_nodes (as_nodes *nodes)
 
AS_EXTERN void as_cluster_remove_seed (as_cluster *cluster, const char *hostname, uint16_t port)
 
AS_EXTERN as_status as_cluster_reserve_all_nodes (as_cluster *cluster, as_error *err, as_nodes **nodes)
 
as_status as_cluster_validate_size (as_cluster *cluster, as_error *err, uint32_t *size)
 
static void as_node_close_conn_error (as_node *node, as_socket *sock, as_conn_pool *pool)
 
AS_EXTERN as_nodeas_node_get_by_name (as_cluster *cluster, const char *name)
 
static uint32_t as_node_get_error_rate (as_node *node)
 
AS_EXTERN as_nodeas_node_get_random (as_cluster *cluster)
 
static void as_node_incr_error_rate (as_node *node)
 
static void as_node_put_conn_error (as_node *node, as_socket *sock)
 
static void as_node_reset_error_rate (as_node *node)
 
static bool as_node_valid_error_rate (as_node *node)
 
AS_EXTERN void as_nodes_destroy (as_nodes *nodes)
 
static void as_nodes_release (as_nodes *nodes)
 
static as_nodesas_nodes_reserve (as_cluster *cluster)
 
static as_nodeas_partition_get_node (as_cluster *cluster, const char *ns, void *partition, as_node *prev_node, as_policy_replica replica, uint8_t replica_size, uint8_t *replica_index)
 
as_nodeas_partition_reg_get_node (as_cluster *cluster, const char *ns, as_partition *p, as_node *prev_node, as_policy_replica replica, uint8_t replica_size, uint8_t *replica_index)
 
as_nodeas_partition_shm_get_node (as_cluster *cluster, const char *ns, struct as_partition_shm_s *partition, as_node *prev_node, as_policy_replica replica, uint8_t replica_size, uint8_t *replica_index)
 

Typedef Documentation

◆ as_release_fn

typedef void(* as_release_fn) (void *value)
private

Reference counted release function definition.

Definition at line 79 of file as_cluster.h.

Function Documentation

◆ as_cluster_add_delay_queue_timeout()

static void as_cluster_add_delay_queue_timeout ( as_cluster * cluster)
inlinestaticprivate

Increment async delay queue timeout count.

Definition at line 668 of file as_cluster.h.

References as_incr_uint64, and as_cluster::delay_queue_timeout_count.

◆ as_cluster_add_retries()

static void as_cluster_add_retries ( as_cluster * cluster,
uint32_t count )
inlinestaticprivate

Add transaction retry count. There can be multiple retries for a single transaction.

Definition at line 648 of file as_cluster.h.

References as_faa_uint64, and as_cluster::retry_count.

◆ as_cluster_add_retry()

static void as_cluster_add_retry ( as_cluster * cluster)
inlinestaticprivate

Increment async delay queue timeout count.

Definition at line 638 of file as_cluster.h.

References as_incr_uint64, and as_cluster::retry_count.

◆ as_cluster_add_seed()

AS_EXTERN void as_cluster_add_seed ( as_cluster * cluster,
const char * hostname,
const char * tls_name,
uint16_t port )

Add seed to cluster.

◆ as_cluster_add_tran()

static void as_cluster_add_tran ( as_cluster * cluster)
inlinestaticprivate

Increment transaction count when metrics are enabled.

Definition at line 616 of file as_cluster.h.

References as_incr_uint64, as_cluster::metrics_enabled, and as_cluster::tran_count.

◆ as_cluster_change_password()

void as_cluster_change_password ( as_cluster * cluster,
const char * user,
const char * password,
const char * password_hash )
private

Change user and password that is used to authenticate with cluster servers.

◆ as_cluster_create()

as_status as_cluster_create ( as_config * config,
as_error * err,
as_cluster ** cluster )

Create and initialize cluster.

◆ as_cluster_destroy()

void as_cluster_destroy ( as_cluster * cluster)

Close all connections and release memory associated with cluster.

◆ as_cluster_disable_metrics()

as_status as_cluster_disable_metrics ( as_error * err,
as_cluster * cluster )
private

Disable the collection of metrics

◆ as_cluster_enable_metrics()

as_status as_cluster_enable_metrics ( as_error * err,
as_cluster * cluster,
as_metrics_policy * policy )
private

Enable the collection of metrics

◆ as_cluster_get_delay_queue_timeout_count()

static uint64_t as_cluster_get_delay_queue_timeout_count ( const as_cluster * cluster)
inlinestaticprivate

Return async delay queue timeout count.

Definition at line 678 of file as_cluster.h.

References as_load_uint64, and as_cluster::delay_queue_timeout_count.

◆ as_cluster_get_node_names()

void as_cluster_get_node_names ( as_cluster * cluster,
int * n_nodes,
char ** node_names )

Get all node names in cluster.

◆ as_cluster_get_retry_count()

static uint64_t as_cluster_get_retry_count ( const as_cluster * cluster)
inlinestaticprivate

Return transaction retry count. The value is cumulative and not reset per metrics interval.

Definition at line 658 of file as_cluster.h.

References as_load_uint64, and as_cluster::retry_count.

◆ as_cluster_get_tran_count()

static uint64_t as_cluster_get_tran_count ( const as_cluster * cluster)
inlinestaticprivate

Return transaction count. The value is cumulative and not reset per metrics interval.

Definition at line 628 of file as_cluster.h.

References as_load_uint64, and as_cluster::tran_count.

◆ as_cluster_is_connected()

bool as_cluster_is_connected ( as_cluster * cluster)

Is cluster connected to any server nodes.

◆ as_cluster_release_all_nodes()

static void as_cluster_release_all_nodes ( as_nodes * nodes)
inlinestatic

Release nodes.

Definition at line 527 of file as_cluster.h.

References as_nodes_release().

◆ as_cluster_remove_seed()

AS_EXTERN void as_cluster_remove_seed ( as_cluster * cluster,
const char * hostname,
uint16_t port )

Remove seed from cluster.

◆ as_cluster_reserve_all_nodes()

AS_EXTERN as_status as_cluster_reserve_all_nodes ( as_cluster * cluster,
as_error * err,
as_nodes ** nodes )

Reserve nodes. Return error if cluster is empty.

◆ as_cluster_validate_size()

as_status as_cluster_validate_size ( as_cluster * cluster,
as_error * err,
uint32_t * size )

Verify cluster contains nodes and return node count.

◆ as_node_close_conn_error()

static void as_node_close_conn_error ( as_node * node,
as_socket * sock,
as_conn_pool * pool )
inlinestaticprivate

Close connection and increment node's error count.

Definition at line 752 of file as_cluster.h.

References as_node_close_connection(), and as_node_incr_error_rate().

◆ as_node_get_by_name()

AS_EXTERN as_node * as_node_get_by_name ( as_cluster * cluster,
const char * name )
private

Get node given node name. as_nodes_release() must be called when done with node.

◆ as_node_get_error_rate()

static uint32_t as_node_get_error_rate ( as_node * node)
inlinestaticprivate

Get node's error count.

Definition at line 731 of file as_cluster.h.

References as_load_uint32, and as_node::error_rate.

◆ as_node_get_random()

AS_EXTERN as_node * as_node_get_random ( as_cluster * cluster)
private

Get random node in the cluster. as_nodes_release() must be called when done with node.

◆ as_node_incr_error_rate()

static void as_node_incr_error_rate ( as_node * node)
inlinestaticprivate

Increment node's error count.

Definition at line 709 of file as_cluster.h.

References as_incr_uint32, as_node::cluster, and as_node::error_rate.

◆ as_node_put_conn_error()

static void as_node_put_conn_error ( as_node * node,
as_socket * sock )
inlinestaticprivate

Put connection in pool and increment node's error count.

Definition at line 763 of file as_cluster.h.

References as_node_incr_error_rate(), and as_node_put_connection().

◆ as_node_reset_error_rate()

static void as_node_reset_error_rate ( as_node * node)
inlinestaticprivate

Reset node's error count.

Definition at line 721 of file as_cluster.h.

References as_store_uint32, and as_node::error_rate.

◆ as_node_valid_error_rate()

static bool as_node_valid_error_rate ( as_node * node)
inlinestaticprivate

Validate node's error count.

Definition at line 741 of file as_cluster.h.

References as_load_uint32, as_node::cluster, and as_node::error_rate.

◆ as_nodes_destroy()

AS_EXTERN void as_nodes_destroy ( as_nodes * nodes)

Release each individual node and free nodes struct.

◆ as_nodes_release()

static void as_nodes_release ( as_nodes * nodes)
inlinestatic

Release reference counted access to cluster nodes.

Definition at line 509 of file as_cluster.h.

References as_aaf_uint32_rls, as_fence_acq, as_nodes_destroy(), and as_nodes::ref_count.

◆ as_nodes_reserve()

static as_nodes * as_nodes_reserve ( as_cluster * cluster)
inlinestatic

Reserve reference counted access to cluster nodes.

Definition at line 492 of file as_cluster.h.

References as_incr_uint32, as_load_ptr, as_cluster::nodes, and as_nodes::ref_count.

◆ as_partition_get_node()

static as_node * as_partition_get_node ( as_cluster * cluster,
const char * ns,
void * partition,
as_node * prev_node,
as_policy_replica replica,
uint8_t replica_size,
uint8_t * replica_index )
inlinestaticprivate

Get mapped node given partition and replica. This function does not reserve the node. The caller must reserve the node for future use.

Definition at line 689 of file as_cluster.h.

References as_partition_reg_get_node(), as_partition_shm_get_node(), and as_cluster::shm_info.

◆ as_partition_reg_get_node()

as_node * as_partition_reg_get_node ( as_cluster * cluster,
const char * ns,
as_partition * p,
as_node * prev_node,
as_policy_replica replica,
uint8_t replica_size,
uint8_t * replica_index )
private

Get mapped node given partition and replica. This function does not reserve the node. The caller must reserve the node for future use.

◆ as_partition_shm_get_node()

as_node * as_partition_shm_get_node ( as_cluster * cluster,
const char * ns,
struct as_partition_shm_s * partition,
as_node * prev_node,
as_policy_replica replica,
uint8_t replica_size,
uint8_t * replica_index )
private

Get mapped node given partition and replica. The function does not reserve the node. The caller must reserve the node for future use.