All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Data Structures | Typedefs | Functions
as_cluster.h File Reference
#include <aerospike/as_atomic.h>
#include <aerospike/as_config.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

AS_EXTERN void as_cluster_add_seed (as_cluster *cluster, const char *hostname, const char *tls_name, uint16_t port)
 
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)
 
void as_cluster_get_node_names (as_cluster *cluster, int *n_nodes, char **node_names)
 
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_count (as_node *node)
 
AS_EXTERN as_nodeas_node_get_random (as_cluster *cluster)
 
static void as_node_incr_error_count (as_node *node)
 
static void as_node_put_conn_error (as_node *node, as_socket *sock)
 
static void as_node_reset_error_count (as_node *node)
 
static bool as_node_valid_error_count (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

typedef void(* as_release_fn)(void *value)

Reference counted release function definition.

Definition at line 78 of file as_cluster.h.

Function Documentation

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

Add seed to cluster.

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_status as_cluster_create ( as_config config,
as_error err,
as_cluster **  cluster 
)

Create and initialize cluster.

void as_cluster_destroy ( as_cluster cluster)

Close all connections and release memory associated with cluster.

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

Get all node names in cluster.

bool as_cluster_is_connected ( as_cluster cluster)

Is cluster connected to any server nodes.

static void as_cluster_release_all_nodes ( as_nodes nodes)
inlinestatic

Release nodes.

Definition at line 451 of file as_cluster.h.

References as_nodes_release().

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

Remove seed from cluster.

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_status as_cluster_validate_size ( as_cluster cluster,
as_error err,
uint32_t *  size 
)

Verify cluster contains nodes and return node count.

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 590 of file as_cluster.h.

References as_node_close_connection(), and as_node_incr_error_count().

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.

static uint32_t as_node_get_error_count ( as_node node)
inlinestaticprivate

Get node's error count.

Definition at line 569 of file as_cluster.h.

References as_load_uint32, and as_node::error_count.

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.

static void as_node_incr_error_count ( as_node node)
inlinestaticprivate

Increment node's error count.

Definition at line 547 of file as_cluster.h.

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

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 601 of file as_cluster.h.

References as_node_incr_error_count(), and as_node_put_connection().

static void as_node_reset_error_count ( as_node node)
inlinestaticprivate

Reset node's error count.

Definition at line 559 of file as_cluster.h.

References as_store_uint32, and as_node::error_count.

static bool as_node_valid_error_count ( as_node node)
inlinestaticprivate

Validate node's error count.

Definition at line 579 of file as_cluster.h.

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

AS_EXTERN void as_nodes_destroy ( as_nodes nodes)

Release each individual node and free nodes struct.

static void as_nodes_release ( as_nodes nodes)
inlinestatic

Release reference counted access to cluster nodes.

Definition at line 433 of file as_cluster.h.

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

static as_nodes* as_nodes_reserve ( as_cluster cluster)
inlinestatic

Reserve reference counted access to cluster nodes.

Definition at line 416 of file as_cluster.h.

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

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 527 of file as_cluster.h.

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

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_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.