Skip to content

Commit

Permalink
Merge pull request #150 from aerospike/stage
Browse files Browse the repository at this point in the history
C client 6.6.1
  • Loading branch information
BrianNichols authored May 7, 2024
2 parents 029db7a + d53ed27 commit 9401b0b
Show file tree
Hide file tree
Showing 54 changed files with 2,867 additions and 530 deletions.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,12 @@ AEROSPIKE += as_host.o
AEROSPIKE += as_info.o
AEROSPIKE += as_job.o
AEROSPIKE += as_key.o
AEROSPIKE += as_latency.o
AEROSPIKE += as_list_operations.o
AEROSPIKE += as_lookup.o
AEROSPIKE += as_map_operations.o
AEROSPIKE += as_metrics.o
AEROSPIKE += as_metrics_writer.o
AEROSPIKE += as_node.o
AEROSPIKE += as_operations.o
AEROSPIKE += as_partition.o
Expand Down
2 changes: 1 addition & 1 deletion modules/common
2 changes: 1 addition & 1 deletion modules/mod-lua
2 changes: 2 additions & 0 deletions src/include/aerospike/aerospike.h
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,8 @@ aerospike_new(as_config* config);
* Initialize global lua configuration.
*
* @param config The lua configuration to use for all cluster instances.
*
* @relates aerospike
*/
AS_EXTERN void
aerospike_init_lua(as_config_lua* config);
Expand Down
30 changes: 27 additions & 3 deletions src/include/aerospike/aerospike_stats.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2008-2021 Aerospike, Inc.
* Copyright 2008-2024 Aerospike, Inc.
*
* Portions may be licensed to Aerospike, Inc. under one or more contributor
* license agreements.
Expand Down Expand Up @@ -88,9 +88,16 @@ typedef struct as_node_stats_s {
as_conn_stats pipeline;

/**
* Node error count within current window.
* Transaction error count since node was initialized. If the error is retryable, multiple errors per
* transaction may occur.
*/
uint32_t error_count;
uint64_t error_count;

/**
* Transaction timeout count since node was initialized. If the timeout is retryable (ie socket timeout),
* multiple timeouts per transaction may occur.
*/
uint64_t timeout_count;

} as_node_stats;

Expand Down Expand Up @@ -128,6 +135,11 @@ typedef struct as_cluster_stats_s {
*/
as_event_loop_stats* event_loops;

/**
* Count of transaction retries since cluster was started.
*/
uint64_t retry_count;

/**
* Node count.
*/
Expand Down Expand Up @@ -242,6 +254,18 @@ aerospike_event_loop_stats(as_event_loop* event_loop, as_event_loop_stats* stats
AS_EXTERN char*
aerospike_stats_to_string(as_cluster_stats* stats);

static inline void
as_conn_stats_init(as_conn_stats* stats)
{
stats->in_pool = 0;
stats->in_use = 0;
stats->opened = 0;
stats->closed = 0;
}

void
as_conn_stats_sum(as_conn_stats* stats, as_async_conn_pool* pool);

#ifdef __cplusplus
} // end extern "C"
#endif
6 changes: 3 additions & 3 deletions src/include/aerospike/as_address.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2008-2018 Aerospike, Inc.
* Copyright 2008-2024 Aerospike, Inc.
*
* Portions may be licensed to Aerospike, Inc. under one or more contributor
* license agreements.
Expand Down Expand Up @@ -45,7 +45,7 @@ extern "C" {
* IPv6: [xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx]:<port>
* ~~~~~~~~~~
*/
void
AS_EXTERN void
as_address_name(struct sockaddr* addr, char* name, socklen_t size);

/**
Expand All @@ -58,7 +58,7 @@ as_address_name(struct sockaddr* addr, char* name, socklen_t size);
* IPv6: xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx
* ~~~~~~~~~~
*/
void
AS_EXTERN void
as_address_short_name(struct sockaddr* addr, char* name, socklen_t size);

/**
Expand Down
13 changes: 11 additions & 2 deletions src/include/aerospike/as_async.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2008-2023 Aerospike, Inc.
* Copyright 2008-2024 Aerospike, Inc.
*
* Portions may be licensed to Aerospike, Inc. under one or more contributor
* license agreements.
Expand Down Expand Up @@ -110,7 +110,9 @@ as_async_write_command_create(
cmd->flags = 0;
cmd->replica_size = pi->replica_size;
cmd->replica_index = 0;
cmd->latency_type = AS_LATENCY_TYPE_WRITE;
wcmd->listener = listener;
as_cluster_add_tran(cluster);
return cmd;
}

Expand All @@ -119,7 +121,8 @@ as_async_record_command_create(
as_cluster* cluster, const as_policy_base* policy, as_partition_info* pi,
as_policy_replica replica, uint8_t replica_index, bool deserialize, bool heap_rec,
uint8_t flags, as_async_record_listener listener, void* udata, as_event_loop* event_loop,
as_pipe_listener pipe_listener, size_t size, as_event_parse_results_fn parse_results
as_pipe_listener pipe_listener, size_t size, as_event_parse_results_fn parse_results,
as_latency_type latency_type
)
{
// Allocate enough memory to cover: struct size + write buffer size + auth max buffer size
Expand Down Expand Up @@ -158,7 +161,9 @@ as_async_record_command_create(

cmd->replica_size = pi->replica_size;
cmd->replica_index = replica_index;
cmd->latency_type = latency_type;
rcmd->listener = listener;
as_cluster_add_tran(cluster);
return cmd;
}

Expand Down Expand Up @@ -197,7 +202,9 @@ as_async_value_command_create(
cmd->flags = 0;
cmd->replica_size = pi->replica_size;
cmd->replica_index = 0;
cmd->latency_type = AS_LATENCY_TYPE_WRITE;
vcmd->listener = listener;
as_cluster_add_tran(cluster);
return cmd;
}

Expand Down Expand Up @@ -233,7 +240,9 @@ as_async_info_command_create(
cmd->flags = 0;
cmd->replica_size = 1;
cmd->replica_index = 0;
cmd->latency_type = AS_LATENCY_TYPE_NONE;
icmd->listener = listener;
as_cluster_add_tran(node->cluster);
return cmd;
}

Expand Down
12 changes: 6 additions & 6 deletions src/include/aerospike/as_bit_operations.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2008-2022 Aerospike, Inc.
* Copyright 2008-2024 Aerospike, Inc.
*
* Portions may be licensed to Aerospike, Inc. under one or more contributor
* license agreements.
Expand Down Expand Up @@ -85,8 +85,8 @@ typedef enum as_bit_write_flags_e {
AS_BIT_WRITE_NO_FAIL = 4,

/**
* Allow other valid operations to be committed if this operations is
* denied due to flag constraints.
* Don't fail if the bit operation would increase the blob size.
* Instead, apply the bit operation without increasing the blob size.
*/
AS_BIT_WRITE_PARTIAL = 8
} as_bit_write_flags;
Expand Down Expand Up @@ -195,7 +195,7 @@ as_bit_shift(
AS_EXTERN bool
as_bit_math(
as_operations* ops, const char* name, as_cdt_ctx* ctx, as_bit_policy* policy,
uint16_t command, int bit_offset, uint32_t bit_size, int64_t value, bool sign,
uint16_t command, int bit_offset, uint32_t bit_size, uint64_t value, bool sign,
as_bit_overflow_action action
);

Expand Down Expand Up @@ -499,7 +499,7 @@ as_operations_bit_rshift(
static inline bool
as_operations_bit_add(
as_operations* ops, const char* name, as_cdt_ctx* ctx, as_bit_policy* policy,
int bit_offset, uint32_t bit_size, int64_t value, bool sign, as_bit_overflow_action action
int bit_offset, uint32_t bit_size, uint64_t value, bool sign, as_bit_overflow_action action
)
{
return as_bit_math(ops, name, ctx, policy, AS_BIT_OP_ADD, bit_offset, bit_size, value, sign, action);
Expand All @@ -526,7 +526,7 @@ as_operations_bit_add(
static inline bool
as_operations_bit_subtract(
as_operations* ops, const char* name, as_cdt_ctx* ctx, as_bit_policy* policy,
int bit_offset, uint32_t bit_size, int64_t value, bool sign, as_bit_overflow_action action
int bit_offset, uint32_t bit_size, uint64_t value, bool sign, as_bit_overflow_action action
)
{
return as_bit_math(ops, name, ctx, policy, AS_BIT_OP_SUBTRACT, bit_offset, bit_size, value, sign, action);
Expand Down
2 changes: 1 addition & 1 deletion src/include/aerospike/as_cdt_ctx.h
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ as_cdt_ctx_add_list_value(as_cdt_ctx* ctx, as_val* val)

/**
* Lookup map by index offset.
* <p>
*
* If the index is negative, the resolved index starts backwards from end of list.
* If an index is out of bounds, a parameter error will be returned. Examples:
* <ul>
Expand Down
Loading

0 comments on commit 9401b0b

Please sign in to comment.