24 #include <citrusleaf/cf_queue.h>
25 #include <netinet/in.h>
33 #include <aerospike/ck/ck_pr.h>
42 #define AS_HOSTNAME_SIZE 256
47 #define AS_NODE_NAME_SIZE 20
50 #define AS_NODE_NAME_MAX_SIZE AS_NODE_NAME_SIZE
52 #define AS_FEATURES_GEO (1 << 0)
53 #define AS_FEATURES_DOUBLE (1 << 1)
54 #define AS_FEATURES_BATCH_INDEX (1 << 2)
55 #define AS_FEATURES_REPLICAS_ALL (1 << 3)
56 #define AS_FEATURES_PIPELINING (1 << 4)
57 #define AS_FEATURES_PEERS (1 << 5)
59 #define AS_IP_ADDRESS_SIZE 64
60 #define AS_ADDRESS4_MAX 4
61 #define AS_ADDRESS6_MAX 8
70 typedef struct as_address_s {
74 struct sockaddr_storage addr;
87 typedef struct as_alias_s {
107 typedef struct as_node_s {
242 typedef struct as_node_info_s {
273 struct as_cluster_s* cluster,
const char* hostname,
const char* tls_name,
274 in_port_t port,
bool is_alias,
struct sockaddr* addr,
as_node_info* node_info
292 ck_pr_store_8(&node->
active,
false);
316 ck_pr_dec_32_zero(&node->
ref_count, &destroy);
349 static inline const char*
379 if (cf_queue_push(node->
conn_q, sock) != CF_QUEUE_OK) {
static void as_node_put_connection(as_node *node, as_socket *sock)
static void as_node_deactivate(as_node *node)
void as_node_add_alias(as_node *node, const char *hostname, in_port_t port)
char name[AS_IP_ADDRESS_SIZE]
void as_node_destroy(as_node *node)
struct as_cluster_s * cluster
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)
uint32_t partition_generation
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_close_connection(as_node *node, as_socket *sock)
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_reserve(as_node *node)
static as_address * as_node_get_address(as_node *node)
#define AS_IP_ADDRESS_SIZE