All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Data Structures | Macros | Functions
as_node.h File Reference
#include <aerospike/as_atomic.h>
#include <aerospike/as_config.h>
#include <aerospike/as_conn_pool.h>
#include <aerospike/as_error.h>
#include <aerospike/as_event.h>
#include <aerospike/as_socket.h>
#include <aerospike/as_partition.h>
#include <aerospike/as_queue.h>
#include <aerospike/as_vector.h>
#include <netinet/in.h>
#include <sys/uio.h>
+ Include dependency graph for as_node.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  as_address
struct  as_alias
struct  as_async_conn_pool
struct  as_node
struct  as_node_info
struct  as_rack
struct  as_racks
struct  as_session


#define AS_ADDRESS4_MAX   4
#define AS_ADDRESS6_MAX   8
#define AS_FEATURES_BATCH_ANY   (1 << 2)
#define AS_FEATURES_QUERY_SHOW   (1 << 1)
#define AS_HOSTNAME_SIZE   256
#define AS_NODE_NAME_SIZE   20


static bool as_host_equals (as_host *h1, as_host *h2)
void as_node_add_address (as_node *node, struct sockaddr *addr)
void as_node_add_alias (as_node *node, const char *hostname, uint16_t port)
as_status as_node_authenticate_connection (struct as_cluster_s *cluster, uint64_t deadline_ms)
void as_node_balance_connections (as_node *node)
static void as_node_close_connection (as_node *node, as_socket *sock, as_conn_pool *pool)
static void as_node_close_socket (as_node *node, as_socket *sock)
as_nodeas_node_create (struct as_cluster_s *cluster, as_node_info *node_info)
void as_node_create_min_connections (as_node *node)
static void as_node_deactivate (as_node *node)
AS_EXTERN void as_node_destroy (as_node *node)
static as_addressas_node_get_address (as_node *node)
static const char * as_node_get_address_string (as_node *node)
as_status as_node_get_connection (as_error *err, as_node *node, uint32_t socket_timeout, uint64_t deadline_ms, as_socket *sock)
bool as_node_has_rack (as_node *node, const char *ns, int rack_id)
static void as_node_info_destroy (as_node_info *node_info)
static bool as_node_is_active (const as_node *node)
static as_nodeas_node_load (as_node **node)
static void as_node_put_connection (as_node *node, as_socket *sock)
static void as_node_release (as_node *node)
void as_node_release_delayed (as_node *node)
static void as_node_reserve (as_node *node)
void as_node_signal_login (as_node *node)
static void as_node_store (as_node **trg, as_node *src)
static as_sessionas_session_load (as_session **session)
static void as_session_release (as_session *session)

Macro Definition Documentation

#define AS_ADDRESS4_MAX   4

Definition at line 60 of file as_node.h.

#define AS_ADDRESS6_MAX   8

Definition at line 61 of file as_node.h.

#define AS_FEATURES_BATCH_ANY   (1 << 2)

Definition at line 57 of file as_node.h.


Definition at line 58 of file as_node.h.


Definition at line 55 of file as_node.h.

#define AS_FEATURES_QUERY_SHOW   (1 << 1)

Definition at line 56 of file as_node.h.

#define AS_HOSTNAME_SIZE   256

Maximum size (including NULL byte) of a hostname.

Definition at line 45 of file as_node.h.


Definition at line 53 of file as_node.h.

#define AS_NODE_NAME_SIZE   20

Maximum size of node name

Definition at line 50 of file as_node.h.

Function Documentation

static bool as_host_equals ( as_host h1,
as_host h2 

Are hosts equal.

Definition at line 610 of file as_node.h.

References as_host::name, and as_host::port.

void as_node_add_address ( as_node node,
struct sockaddr *  addr 

Add socket address to node addresses.

void as_node_add_alias ( as_node node,
const char *  hostname,
uint16_t  port 

Add hostname to node aliases.

as_status as_node_authenticate_connection ( struct as_cluster_s *  cluster,
uint64_t  deadline_ms 

Attempt to authenticate given current cluster's user and password.

void as_node_balance_connections ( as_node node)

Balance sync connections.

static void as_node_close_connection ( as_node node,
as_socket sock,
as_conn_pool pool 

Close a node's connection and update node/pool statistics.

Definition at line 561 of file as_node.h.

References as_conn_pool_decr(), as_incr_uint32, as_socket_close(), and as_node::sync_conns_closed.

static void as_node_close_socket ( as_node node,
as_socket sock 

Close a node's connection and update node statistics.

Definition at line 573 of file as_node.h.

References as_incr_uint32, as_socket_close(), and as_node::sync_conns_closed.

as_node* as_node_create ( struct as_cluster_s *  cluster,
as_node_info node_info 

Create new cluster node.

void as_node_create_min_connections ( as_node node)

Create configured minimum number of connections.

static void as_node_deactivate ( as_node node)

Set node to inactive.

Definition at line 454 of file as_node.h.

References as_node::active, and as_store_uint8_rls.

AS_EXTERN void as_node_destroy ( as_node node)

Close all connections in pool and free resources.

static as_address* as_node_get_address ( as_node node)

Get primary socket address.

Definition at line 528 of file as_node.h.

References as_node::address_index, and as_node::addresses.

static const char* as_node_get_address_string ( as_node node)

Get socket address as a string.

Definition at line 537 of file as_node.h.

References as_node::address_index, as_node::addresses, and as_address::name.

as_status as_node_get_connection ( as_error err,
as_node node,
uint32_t  socket_timeout,
uint64_t  deadline_ms,
as_socket sock 

Get a connection to the given node from pool and validate. Return 0 on success.

bool as_node_has_rack ( as_node node,
const char *  ns,
int  rack_id 

Does node contain rack.

static void as_node_info_destroy ( as_node_info node_info)

Destroy node_info contents.

Definition at line 620 of file as_node.h.

References as_socket_close(), as_node_info::session, and as_node_info::socket.

static bool as_node_is_active ( const as_node node)

Check if node is active from a transaction thread.

Definition at line 444 of file as_node.h.

References as_node::active, and as_load_uint8_acq.

static as_node* as_node_load ( as_node **  node)

Read volatile node.

Definition at line 465 of file as_node.h.

References as_load_ptr.

static void as_node_put_connection ( as_node node,
as_socket sock 

Put connection back into pool.

Definition at line 584 of file as_node.h.

References as_conn_pool_push_head(), as_node_close_connection(), as_socket::last_used, and as_socket::pool.

static void as_node_release ( as_node node)

Release existing cluster node.

Definition at line 495 of file as_node.h.

References as_aaf_uint32_rls, as_fence_acq, as_node_destroy(), and as_node::ref_count.

void as_node_release_delayed ( as_node node)

Release node on next cluster tend iteration.

static void as_node_reserve ( as_node node)

Reserve existing cluster node.

Definition at line 475 of file as_node.h.

References as_incr_uint32, and as_node::ref_count.

void as_node_signal_login ( as_node node)

Tell tend thread to perform another node login.

static void as_node_store ( as_node **  trg,
as_node src 

Set volatile node.

Definition at line 485 of file as_node.h.

References as_store_ptr_rls.

static as_session* as_session_load ( as_session **  session)

Volatile read session pointer.

Definition at line 645 of file as_node.h.

References as_load_ptr.

static void as_session_release ( as_session session)

Release existing session.

Definition at line 655 of file as_node.h.

References as_aaf_uint32_rls, and as_session::ref_count.