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_error.h>
#include <aerospike/as_event.h>
#include <aerospike/as_queue.h>
#include <aerospike/as_vector.h>
#include <citrusleaf/cf_queue.h>
#include <netinet/in.h>
#include <sys/uio.h>
#include <aerospike/ck/ck_pr.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_host
 
struct  as_node
 
struct  as_node_info
 

Macros

#define AS_HOSTNAME_SIZE   256
 
#define AS_NODE_NAME_MAX_SIZE   AS_NODE_NAME_SIZE
 
#define AS_NODE_NAME_SIZE   20
 

Functions

static bool as_host_equals (as_host *h1, as_host *h2)
 
void as_node_add_address (as_node *node, as_host *host, struct sockaddr_in *addr)
 
static void as_node_close_connection (as_node *node, int fd)
 
as_nodeas_node_create (struct as_cluster_s *cluster, as_host *host, struct sockaddr_in *addr, as_node_info *node_info)
 
static void as_node_deactivate (as_node *node)
 
void as_node_destroy (as_node *node)
 
static struct sockaddr_in * as_node_get_address (as_node *node)
 
static as_addressas_node_get_address_full (as_node *node)
 
as_status as_node_get_connection (as_error *err, as_node *node, uint64_t deadline_ms, int *fd)
 
static void as_node_put_connection (as_node *node, int fd)
 
static void as_node_release (as_node *node)
 
static void as_node_reserve (as_node *node)
 

Macro Definition Documentation

#define AS_HOSTNAME_SIZE   256

Maximum size (including NULL byte) of a hostname.

Definition at line 41 of file as_node.h.

#define AS_NODE_NAME_MAX_SIZE   AS_NODE_NAME_SIZE

Definition at line 49 of file as_node.h.

#define AS_NODE_NAME_SIZE   20

Maximum size of node name

Definition at line 46 of file as_node.h.

Function Documentation

static bool as_host_equals ( as_host h1,
as_host h2 
)
inlinestaticprivate

Are hosts equal.

Definition at line 388 of file as_node.h.

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

void as_node_add_address ( as_node node,
as_host host,
struct sockaddr_in *  addr 
)
private

Add socket address to node addresses.

static void as_node_close_connection ( as_node node,
int  fd 
)
inlinestaticprivate

Close a node's connection and do not put back into pool.

Definition at line 366 of file as_node.h.

References as_node::conn_count.

as_node* as_node_create ( struct as_cluster_s *  cluster,
as_host host,
struct sockaddr_in *  addr,
as_node_info node_info 
)
private

Create new cluster node.

static void as_node_deactivate ( as_node node)
inlinestaticprivate

Set node to inactive.

Definition at line 293 of file as_node.h.

References as_node::active.

void as_node_destroy ( as_node node)
private

Close all connections in pool and free resources.

static struct sockaddr_in* as_node_get_address ( as_node node)
staticprivate

Get socket address and name.

Definition at line 339 of file as_node.h.

References as_address::addr, as_node::address_index, as_node::addresses, and as_vector_get().

static as_address* as_node_get_address_full ( as_node node)
inlinestatic

Get socket address and name.

Definition at line 349 of file as_node.h.

References as_node::address_index, as_node::addresses, and as_vector_get().

as_status as_node_get_connection ( as_error err,
as_node node,
uint64_t  deadline_ms,
int *  fd 
)
private

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

static void as_node_put_connection ( as_node node,
int  fd 
)
inlinestaticprivate

Put connection back into pool.

Definition at line 376 of file as_node.h.

References as_node_close_connection(), and as_node::conn_q.

static void as_node_release ( as_node node)
inlinestaticprivate

Release existing cluster node.

Definition at line 315 of file as_node.h.

References as_node_destroy(), and as_node::ref_count.

static void as_node_reserve ( as_node node)
inlinestaticprivate

Reserve existing cluster node.

Definition at line 304 of file as_node.h.

References as_node::ref_count.