24 #include <netinet/in.h>
32 #include <aerospike/ck/ck_pr.h>
41 #define AS_HOSTNAME_SIZE 256
46 #define AS_NODE_NAME_SIZE 20
49 #define AS_NODE_NAME_MAX_SIZE AS_NODE_NAME_SIZE
51 #define AS_FEATURES_GEO (1 << 0)
52 #define AS_FEATURES_DOUBLE (1 << 1)
53 #define AS_FEATURES_BATCH_INDEX (1 << 2)
54 #define AS_FEATURES_REPLICAS_ALL (1 << 3)
55 #define AS_FEATURES_PIPELINING (1 << 4)
56 #define AS_FEATURES_PEERS (1 << 5)
58 #define AS_ADDRESS4_MAX 4
59 #define AS_ADDRESS6_MAX 8
68 typedef struct as_address_s {
72 struct sockaddr_storage addr;
85 typedef struct as_alias_s {
104 typedef struct as_queue_lock_s {
125 typedef struct as_node_s {
266 typedef struct as_node_info_s {
297 struct as_cluster_s* cluster,
const char* hostname,
const char* tls_name,
298 in_port_t port,
bool is_alias,
struct sockaddr* addr,
as_node_info* node_info
316 ck_pr_store_8(&node->
active,
false);
340 ck_pr_dec_32_zero(&node->
ref_count, &destroy);
373 static inline const char*
401 pthread_mutex_lock(&queue->
lock);
403 pthread_mutex_unlock(&queue->
lock);
422 pthread_mutex_lock(&queue->
lock);
424 pthread_mutex_unlock(&queue->
lock);
428 pthread_mutex_lock(&queue->
lock);
430 pthread_mutex_unlock(&queue->
lock);
static void as_node_deactivate(as_node *node)
void as_node_add_alias(as_node *node, const char *hostname, in_port_t port)
#define AS_IP_ADDRESS_SIZE
char name[AS_IP_ADDRESS_SIZE]
void as_node_destroy(as_node *node)
struct as_cluster_s * cluster
as_status as_node_authenticate_connection(struct as_cluster_s *cluster, const char *user, const char *password)
static bool as_host_equals(as_host *h1, as_host *h2)
uint32_t peers_generation
#define AS_NODE_NAME_SIZE
void as_node_add_address(as_node *node, struct sockaddr *addr)
struct as_queue_lock_s * queue
bool as_queue_push(as_queue *queue, const void *ptr)
uint32_t partition_generation
static void as_node_put_connection(as_socket *sock)
as_status as_node_get_connection(as_error *err, as_node *node, uint64_t deadline_ms, as_socket *sock)
as_node * as_node_create(struct as_cluster_s *cluster, const char *hostname, const char *tls_name, in_port_t port, bool is_alias, struct sockaddr *addr, as_node_info *node_info)
static void as_node_release(as_node *node)
static const char * as_node_get_address_string(as_node *node)
void as_socket_close(as_socket *sock)
static void as_node_close_connection(as_socket *sock)
static void as_node_reserve(as_node *node)
static as_address * as_node_get_address(as_node *node)