Loading...
Searching...
No Matches
as_command.h
Go to the documentation of this file.
1/*
2 * Copyright 2008-2024 Aerospike, Inc.
3 *
4 * Portions may be licensed to Aerospike, Inc. under one or more contributor
5 * license agreements.
6 *
7 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
8 * use this file except in compliance with the License. You may obtain a copy of
9 * the License at http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14 * License for the specific language governing permissions and limitations under
15 * the License.
16 */
17#pragma once
18
19#include <aerospike/as_bin.h>
20#include <aerospike/as_buffer.h>
22#include <aerospike/as_key.h>
24#include <aerospike/as_proto.h>
25#include <aerospike/as_random.h>
26#include <aerospike/as_record.h>
27#include <citrusleaf/cf_byte_order.h>
28
29#ifdef __cplusplus
30extern "C" {
31#endif
32
33/******************************************************************************
34 * MACROS
35 *****************************************************************************/
36
37// Command Flags
38#define AS_COMMAND_FLAGS_READ 1
39#define AS_COMMAND_FLAGS_BATCH 2
40#define AS_COMMAND_FLAGS_LINEARIZE 4
41#define AS_COMMAND_FLAGS_SPLIT_RETRY 8
42
43// Field IDs
44#define AS_FIELD_NAMESPACE 0
45#define AS_FIELD_SETNAME 1
46#define AS_FIELD_KEY 2
47#define AS_FIELD_DIGEST 4
48#define AS_FIELD_TASK_ID 7
49#define AS_FIELD_SOCKET_TIMEOUT 9
50#define AS_FIELD_RPS 10
51#define AS_FIELD_PID_ARRAY 11
52#define AS_FIELD_DIGEST_ARRAY 12
53#define AS_FIELD_MAX_RECORDS 13
54#define AS_FIELD_BVAL_ARRAY 15
55#define AS_FIELD_INDEX_RANGE 22
56#define AS_FIELD_INDEX_CONTEXT 23
57#define AS_FIELD_INDEX_TYPE 26
58#define AS_FIELD_UDF_PACKAGE_NAME 30
59#define AS_FIELD_UDF_FUNCTION 31
60#define AS_FIELD_UDF_ARGLIST 32
61#define AS_FIELD_UDF_OP 33
62#define AS_FIELD_QUERY_BINS 40
63#define AS_FIELD_BATCH_INDEX 41
64#define AS_FIELD_FILTER 43
65
66// Message info1 bits
67#define AS_MSG_INFO1_READ (1 << 0) // contains a read operation
68#define AS_MSG_INFO1_GET_ALL (1 << 1) // get all bins, period
69#define AS_MSG_INFO1_SHORT_QUERY (1 << 2) // short query
70#define AS_MSG_INFO1_BATCH_INDEX (1 << 3) // batch
71#define AS_MSG_INFO1_XDR (1 << 4) // operation is being performed by XDR
72#define AS_MSG_INFO1_GET_NOBINDATA (1 << 5) // do not get information about bins and its data
73#define AS_MSG_INFO1_READ_MODE_AP_ALL (1 << 6) // read mode all for AP namespaces.
74#define AS_MSG_INFO1_COMPRESS_RESPONSE (1 << 7) // tell server to compress it's response.
75
76// Message info2 bits
77#define AS_MSG_INFO2_WRITE (1 << 0) // contains a write semantic
78#define AS_MSG_INFO2_DELETE (1 << 1) // delete record
79#define AS_MSG_INFO2_GENERATION (1 << 2) // pay attention to the generation
80#define AS_MSG_INFO2_GENERATION_GT (1 << 3) // apply write if new generation >= old, good for restore
81#define AS_MSG_INFO2_DURABLE_DELETE (1 << 4) // transaction resulting in record deletion leaves tombstone (Enterprise only).
82#define AS_MSG_INFO2_CREATE_ONLY (1 << 5) // write record only if it doesn't exist
83#define AS_MSG_INFO2_RELAX_AP_LONG_QUERY (1 << 6) // treat as long query, but relax read consistency.
84#define AS_MSG_INFO2_RESPOND_ALL_OPS (1 << 7) // return a result for every operation.
85
86// Message info3 bits
87#define AS_MSG_INFO3_LAST (1 << 0) // this is the last of a multi-part message
88#define AS_MSG_INFO3_COMMIT_MASTER (1 << 1) // write commit level - bit 0
89// On send: Do not return partition done in scan/query.
90// On receive: Specified partition is done in scan/query.
91#define AS_MSG_INFO3_PARTITION_DONE (1 << 2)
92#define AS_MSG_INFO3_UPDATE_ONLY (1 << 3) // update existing record only, do not create new record
93#define AS_MSG_INFO3_CREATE_OR_REPLACE (1 << 4) // completely replace existing record, or create new record
94#define AS_MSG_INFO3_REPLACE_ONLY (1 << 5) // completely replace existing record, do not create new record
95#define AS_MSG_INFO3_SC_READ_TYPE (1 << 6) // see below
96#define AS_MSG_INFO3_SC_READ_RELAX (1 << 7) // see below
97// Interpret SC_READ bits in info3.
98//
99// RELAX TYPE
100// strict
101// ------
102// 0 0 sequential (default)
103// 0 1 linearize
104//
105// relaxed
106// -------
107// 1 0 allow prole
108// 1 1 allow unavailable
109
110// Misc
111#define AS_HEADER_SIZE 30
112#define AS_FIELD_HEADER_SIZE 5
113#define AS_OPERATION_HEADER_SIZE 8
114
115#define AS_STACK_BUF_SIZE (1024 * 16)
116#define AS_COMPRESS_THRESHOLD 128
117
118/**
119 * @private
120 * Macros use these stand-ins for cf_malloc() / cf_free(), so that
121 * instrumentation properly substitutes them.
122 */
123static inline void*
124local_malloc(size_t size)
125{
126 return cf_malloc(size);
127}
128
129static inline void
130local_free(void* memory)
131{
132 cf_free(memory);
133}
134
135/**
136 * @private
137 * Allocate command buffer on stack or heap depending on given size.
138 */
139#define as_command_buffer_init(_sz) (_sz > AS_STACK_BUF_SIZE) ? (uint8_t*)local_malloc(_sz) : (uint8_t*)alloca(_sz)
140
141/**
142 * @private
143 * Free command buffer.
144 */
145#define as_command_buffer_free(_buf, _sz) if (_sz > AS_STACK_BUF_SIZE) {local_free(_buf);}
146
147/******************************************************************************
148 * TYPES
149 *****************************************************************************/
150
151/**
152 * @private
153 * Write buffer callback used in as_command_send().
154 */
155typedef size_t (*as_write_fn) (void* udata, uint8_t* buf);
156
157struct as_command_s;
158
159/**
160 * @private
161 * Parse results callback used in as_command_execute().
162 */
164 as_error* err, struct as_command_s* cmd, as_node* node, uint8_t* buf, size_t size
165 );
166
167/**
168 * @private
169 * Synchronous command data.
170 */
195
196/**
197 * @private
198 * Data used in as_command_parse_result().
199 */
200typedef struct as_command_parse_result_data_s {
204
205/******************************************************************************
206 * FUNCTIONS
207 ******************************************************************************/
208
209/**
210 * @private
211 * Destroy buffers when error occurs before bins have been written.
212 */
213static inline void
215{
216 as_buffer b;
217
218 while (as_queue_pop(buffers, &b)) {
219 cf_free(b.data);
220 }
221 as_queue_destroy(buffers);
222}
223
224/**
225 * @private
226 * Calculate size of user key.
227 */
228size_t
230
231/**
232 * @private
233 * Calculate size of command header plus key fields.
234 */
235size_t
236as_command_key_size(as_policy_key policy, const as_key* key, uint16_t* n_fields);
237
238/**
239 * @private
240 * Calculate size of string field.
241 */
242static inline size_t
244{
245 return strlen(value) + AS_FIELD_HEADER_SIZE;
246}
247
248/**
249 * @private
250 * Calculate size of field structure given field value size.
251 */
252static inline size_t
254{
255 return size + AS_FIELD_HEADER_SIZE;
256}
257
258/**
259 * @private
260 * Increment size by bin size.
261 */
263as_command_bin_size(const as_bin* bin, as_queue* buffers, size_t* size, as_error* err);
264
265/**
266 * @private
267 * Calculate size of bin name. Return error is bin name greater than AS_BIN_NAME_MAX_LEN characters.
268 */
269static inline as_status
270as_command_bin_name_size(as_error* err, const char* name, size_t* size)
271{
272 size_t s = strlen(name);
273
274 if (s > AS_BIN_NAME_MAX_LEN) {
275 return as_error_update(err, AEROSPIKE_ERR_PARAM, "Bin name too long: %s", name);
276 }
277 (*size) += s + AS_OPERATION_HEADER_SIZE;
278 return AEROSPIKE_OK;
279}
280
281/**
282 * @private
283 * Calculate size of string operation.
284 */
285static inline size_t
287{
288 return strlen(value) + AS_OPERATION_HEADER_SIZE;
289}
290
291/**
292 * @private
293 * Set read attributes for read header commands.
294 */
295static inline void
297 as_policy_read_mode_ap read_mode_ap, as_policy_read_mode_sc read_mode_sc,
298 uint8_t* read_attr, uint8_t* info_attr
299 )
300{
301 switch (read_mode_sc) {
302 default:
304 break;
305
307 *info_attr |= AS_MSG_INFO3_SC_READ_TYPE;
308 break;
309
311 *info_attr |= AS_MSG_INFO3_SC_READ_RELAX;
312 break;
313
316 break;
317 }
318
319 if (read_mode_ap == AS_POLICY_READ_MODE_AP_ALL) {
320 *read_attr |= AS_MSG_INFO1_READ_MODE_AP_ALL;
321 }
322}
323
324/**
325 * @private
326 * Set compress attributes when compress is true.
327 */
328static inline void
329as_command_set_attr_compress(bool compress, uint8_t* read_attr)
330{
331 if (compress) {
332 *read_attr |= AS_MSG_INFO1_COMPRESS_RESPONSE;
333 }
334}
335
336/**
337 * @private
338 * Set read attributes for read commands.
339 */
340static inline void
342 as_policy_read_mode_ap read_mode_ap, as_policy_read_mode_sc read_mode_sc, bool compress,
343 uint8_t* read_attr, uint8_t* info_attr
344 )
345{
346 as_command_set_attr_read_header(read_mode_ap, read_mode_sc, read_attr, info_attr);
347 as_command_set_attr_compress(compress, read_attr);
348}
349
350/**
351 * @private
352 * Write command header for write commands.
353 */
354uint8_t*
356 uint8_t* cmd, const as_policy_base* policy, as_policy_commit_level commit_level,
357 as_policy_exists exists, as_policy_gen gen_policy, uint32_t gen, uint32_t ttl,
358 uint16_t n_fields, uint16_t n_bins, bool durable_delete, uint8_t read_attr, uint8_t write_attr,
359 uint8_t info_attr
360 );
361
362/**
363 * @private
364 * Write command header for read commands.
365 */
366uint8_t*
368 uint8_t* cmd, const as_policy_base* policy, as_policy_read_mode_ap read_mode_ap,
369 as_policy_read_mode_sc read_mode_sc, int read_ttl, uint32_t timeout, uint16_t n_fields,
370 uint16_t n_bins, uint8_t read_attr, uint8_t write_attr, uint8_t info_attr
371 );
372
373/**
374 * @private
375 * Write command header for read header commands.
376 */
377uint8_t*
379 uint8_t* cmd, const as_policy_base* policy, as_policy_read_mode_ap read_mode_ap,
380 as_policy_read_mode_sc read_mode_sc, int read_ttl, uint16_t n_fields, uint16_t n_bins,
381 uint8_t read_attr
382 );
383
384/**
385 * @private
386 * Write field header.
387 */
388static inline uint8_t*
389as_command_write_field_header(uint8_t* p, uint8_t id, uint32_t size)
390{
391 *(uint32_t*)p = cf_swap_to_be32(size+1);
392 p += 4;
393 *p++ = id;
394 return p;
395}
396
397/**
398 * @private
399 * Write string field.
400 */
401static inline uint8_t*
402as_command_write_field_string(uint8_t* begin, uint8_t id, const char* val)
403{
404 uint8_t* p = begin + AS_FIELD_HEADER_SIZE;
405
406 // Copy string, but do not transfer null byte.
407 while (*val) {
408 *p++ = *val++;
409 }
410 as_command_write_field_header(begin, id, (uint32_t)(p - begin - AS_FIELD_HEADER_SIZE));
411 return p;
412}
413
414/**
415 * @private
416 * Write uint32_t field.
417 */
418static inline uint8_t*
419as_command_write_field_uint32(uint8_t* p, uint8_t id, uint32_t val)
420{
421 p = as_command_write_field_header(p, id, sizeof(uint32_t));
422 *(uint32_t*)p = cf_swap_to_be32(val);
423 return p + sizeof(uint32_t);
424}
425
426/**
427 * @private
428 * Write uint64_t field.
429 */
430static inline uint8_t*
431as_command_write_field_uint64(uint8_t* p, uint8_t id, uint64_t val)
432{
433 p = as_command_write_field_header(p, id, sizeof(uint64_t));
434 *(uint64_t*)p = cf_swap_to_be64(val);
435 return p + sizeof(uint64_t);
436}
437
438/**
439 * @private
440 * Write as_buffer field.
441 */
442static inline uint8_t*
443as_command_write_field_buffer(uint8_t* p, uint8_t id, as_buffer* buffer)
444{
445 p = as_command_write_field_header(p, id, buffer->size);
446 memcpy(p, buffer->data, buffer->size);
447 return p + buffer->size;
448}
449
450/**
451 * @private
452 * Write digest field.
453 */
454static inline uint8_t*
461
462/**
463 * @private
464 * Write user key.
465 */
466uint8_t*
467as_command_write_user_key(uint8_t* begin, const as_key* key);
468
469/**
470 * @private
471 * Write key structure.
472 */
473uint8_t*
474as_command_write_key(uint8_t* p, as_policy_key policy, const as_key* key);
475
476/**
477 * @private
478 * Write bin header and bin name.
479 */
480uint8_t*
481as_command_write_bin_name(uint8_t* cmd, const char* name);
482
483/**
484 * @private
485 * Write bin.
486 */
487uint8_t*
489 uint8_t* begin, as_operator operation_type, const as_bin* bin, as_queue* buffers
490 );
491
492/**
493 * @private
494 * Finish writing command.
495 */
496static inline size_t
497as_command_write_end(uint8_t* begin, uint8_t* end)
498{
499 uint64_t len = end - begin;
500 uint64_t proto = (len - 8) | ((uint64_t)AS_PROTO_VERSION << 56) | ((uint64_t)AS_MESSAGE_TYPE << 48);
501 *(uint64_t*)begin = cf_swap_to_be64(proto);
502 return len;
503}
504
505/**
506 * @private
507 * Finish writing compressed command.
508 */
509static inline size_t
510as_command_compress_write_end(uint8_t* begin, uint8_t* end, uint64_t uncompressed_sz)
511{
512 uint64_t len = end - begin;
513 uint64_t proto = (len - 8) | ((uint64_t)AS_PROTO_VERSION << 56) | ((uint64_t)AS_COMPRESSED_MESSAGE_TYPE << 48);
514 *(uint64_t*)begin = cf_swap_to_be64(proto);
515 ((as_compressed_proto *)begin)->uncompressed_sz = cf_swap_to_be64(uncompressed_sz);
516 return len;
517}
518
519/**
520 * @private
521 * Calculate max size the compressed command buffer.
522 */
523size_t
525
526/**
527 * @private
528 * Compress command buffer.
529 */
531as_command_compress(as_error* err, uint8_t* cmd, size_t cmd_sz, uint8_t* compressed_cmd, size_t* compressed_size);
532
533/**
534 * @private
535 * Return timeout to be sent to server for single record transactions.
536 */
537static inline uint32_t
539{
540 return (policy->socket_timeout < policy->total_timeout && policy->socket_timeout != 0)?
541 policy->socket_timeout : policy->total_timeout;
542}
543
544/**
545 * @private
546 * Start command timer.
547 */
548static inline void
550{
551 const as_policy_base* policy = cmd->policy;
552
553 cmd->max_retries = policy->max_retries;
554 cmd->iteration = 0;
555 cmd->sent = 0;
556
557 if (policy->total_timeout > 0) {
558 cmd->socket_timeout = (policy->socket_timeout == 0 ||
559 policy->socket_timeout > policy->total_timeout)?
560 policy->total_timeout : policy->socket_timeout;
561
562 cmd->total_timeout = policy->total_timeout;
563 cmd->deadline_ms = cf_getms() + policy->total_timeout;
564 }
565 else {
566 cmd->socket_timeout = policy->socket_timeout;
567 cmd->total_timeout = policy->total_timeout;
568 cmd->deadline_ms = 0;
569 }
570}
571
572/**
573 * @private
574 * Write buffer and send command to the server.
575 */
578 as_command* cmd, as_error* err, uint32_t comp_threshold, as_write_fn write_fn, void* udata
579 );
580
581/**
582 * @private
583 * Send command to the server.
584 */
587
588/**
589 * @private
590 * Parse header of server response.
591 */
593as_command_parse_header(as_error* err, as_command* cmd, as_node* node, uint8_t* buf, size_t size);
594
595/**
596 * @private
597 * Parse server record. Used for reads.
598 */
600as_command_parse_result(as_error* err, as_command* cmd, as_node* node, uint8_t* buf, size_t size);
601
602/**
603 * @private
604 * Parse server success or failure result.
605 */
607as_command_parse_success_failure(as_error* err, as_command* cmd, as_node* node, uint8_t* buf, size_t size);
608
609/**
610 * @private
611 * Parse server success or failure bins.
612 */
614as_command_parse_success_failure_bins(uint8_t** pp, as_error* err, as_msg* msg, as_val** value);
615
616/**
617 * @private
618 * Parse bins received from the server.
619 */
621as_command_parse_bins(uint8_t** pp, as_error* err, as_record* rec, uint32_t n_bins, bool deserialize);
622
623/**
624 * @private
625 * Parse user defined function error.
626 */
628as_command_parse_udf_failure(uint8_t* p, as_error* err, as_msg* msg, as_status status);
629
630/**
631 * @private
632 * Skip over fields section in returned data.
633 */
634uint8_t*
635as_command_ignore_fields(uint8_t* p, uint32_t n_fields);
636
637/**
638 * @private
639 * Skip over bins in returned data.
640 */
641uint8_t*
642as_command_ignore_bins(uint8_t* p, uint32_t n_bins);
643
644/**
645 * @private
646 * Parse key fields received from server. Used for reads.
647 */
648uint8_t*
649as_command_parse_key(uint8_t* p, uint32_t n_fields, as_key* key, uint64_t* bval);
650
651/**
652 * @private
653 * Return random task id if not specified.
654 */
655static inline uint64_t
656as_task_id_resolve(uint64_t* task_id_ptr)
657{
658 if (! task_id_ptr) {
659 return as_random_get_uint64();
660 }
661
662 if (*task_id_ptr == 0) {
663 *task_id_ptr = as_random_get_uint64();
664 }
665 return *task_id_ptr;
666}
667
668/**
669 * @private
670 * Return command's starting replica index for AS_POLICY_REPLICA_ANY.
671 */
672uint8_t
674
675/**
676 * @private
677 * Return starting replica index for read commands.
678 */
679static inline uint8_t
684
685/**
686 * @private
687 * Convert replica target for write commands.
688 */
689static inline as_policy_replica
691{
692 // Writes should always go to master node on first attempt.
693 // Allow prole on retry when possible.
694 return (replica == AS_POLICY_REPLICA_MASTER)? replica : AS_POLICY_REPLICA_SEQUENCE;
695}
696
697#ifdef __cplusplus
698} // end extern "C"
699#endif
#define AS_BIN_NAME_MAX_LEN
Definition as_bin.h:44
as_status(* as_parse_results_fn)(as_error *err, struct as_command_s *cmd, as_node *node, uint8_t *buf, size_t size)
Definition as_command.h:163
size_t as_command_compress_max_size(size_t cmd_sz)
static size_t as_command_field_size(size_t size)
Definition as_command.h:253
static as_status as_command_bin_name_size(as_error *err, const char *name, size_t *size)
Definition as_command.h:270
as_status as_command_parse_udf_failure(uint8_t *p, as_error *err, as_msg *msg, as_status status)
static size_t as_command_write_end(uint8_t *begin, uint8_t *end)
Definition as_command.h:497
size_t(* as_write_fn)(void *udata, uint8_t *buf)
Definition as_command.h:155
as_status as_command_bin_size(const as_bin *bin, as_queue *buffers, size_t *size, as_error *err)
static uint8_t * as_command_write_field_string(uint8_t *begin, uint8_t id, const char *val)
Definition as_command.h:402
uint8_t * as_command_write_bin_name(uint8_t *cmd, const char *name)
static uint8_t * as_command_write_field_digest(uint8_t *p, const as_digest *val)
Definition as_command.h:455
#define AS_OPERATION_HEADER_SIZE
Definition as_command.h:113
static uint32_t as_command_server_timeout(const as_policy_base *policy)
Definition as_command.h:538
static void as_command_set_attr_read(as_policy_read_mode_ap read_mode_ap, as_policy_read_mode_sc read_mode_sc, bool compress, uint8_t *read_attr, uint8_t *info_attr)
Definition as_command.h:341
uint8_t * as_command_write_header_read(uint8_t *cmd, const as_policy_base *policy, as_policy_read_mode_ap read_mode_ap, as_policy_read_mode_sc read_mode_sc, int read_ttl, uint32_t timeout, uint16_t n_fields, uint16_t n_bins, uint8_t read_attr, uint8_t write_attr, uint8_t info_attr)
as_status as_command_send(as_command *cmd, as_error *err, uint32_t comp_threshold, as_write_fn write_fn, void *udata)
static as_policy_replica as_command_write_replica(as_policy_replica replica)
Definition as_command.h:690
size_t as_command_key_size(as_policy_key policy, const as_key *key, uint16_t *n_fields)
static uint8_t * as_command_write_field_uint32(uint8_t *p, uint8_t id, uint32_t val)
Definition as_command.h:419
uint8_t * as_command_ignore_fields(uint8_t *p, uint32_t n_fields)
static uint8_t * as_command_write_field_buffer(uint8_t *p, uint8_t id, as_buffer *buffer)
Definition as_command.h:443
static uint8_t * as_command_write_field_header(uint8_t *p, uint8_t id, uint32_t size)
Definition as_command.h:389
static uint64_t as_task_id_resolve(uint64_t *task_id_ptr)
Definition as_command.h:656
static size_t as_command_string_operation_size(const char *value)
Definition as_command.h:286
static void as_command_start_timer(as_command *cmd)
Definition as_command.h:549
static void as_buffers_destroy(as_queue *buffers)
Definition as_command.h:214
static void as_command_set_attr_read_header(as_policy_read_mode_ap read_mode_ap, as_policy_read_mode_sc read_mode_sc, uint8_t *read_attr, uint8_t *info_attr)
Definition as_command.h:296
static void as_command_set_attr_compress(bool compress, uint8_t *read_attr)
Definition as_command.h:329
static size_t as_command_compress_write_end(uint8_t *begin, uint8_t *end, uint64_t uncompressed_sz)
Definition as_command.h:510
uint8_t * as_command_write_user_key(uint8_t *begin, const as_key *key)
static void local_free(void *memory)
Definition as_command.h:130
as_status as_command_execute(as_command *cmd, as_error *err)
static void * local_malloc(size_t size)
Definition as_command.h:124
#define AS_MSG_INFO1_COMPRESS_RESPONSE
Definition as_command.h:74
as_status as_command_parse_header(as_error *err, as_command *cmd, as_node *node, uint8_t *buf, size_t size)
as_status as_command_parse_success_failure(as_error *err, as_command *cmd, as_node *node, uint8_t *buf, size_t size)
uint8_t * as_command_write_header_read_header(uint8_t *cmd, const as_policy_base *policy, as_policy_read_mode_ap read_mode_ap, as_policy_read_mode_sc read_mode_sc, int read_ttl, uint16_t n_fields, uint16_t n_bins, uint8_t read_attr)
static size_t as_command_string_field_size(const char *value)
Definition as_command.h:243
#define AS_FIELD_HEADER_SIZE
Definition as_command.h:112
#define AS_FIELD_DIGEST
Definition as_command.h:47
uint8_t as_replica_index_any(void)
#define AS_MSG_INFO1_READ_MODE_AP_ALL
Definition as_command.h:73
#define AS_MSG_INFO3_SC_READ_TYPE
Definition as_command.h:95
uint8_t * as_command_write_bin(uint8_t *begin, as_operator operation_type, const as_bin *bin, as_queue *buffers)
static uint8_t as_replica_index_init_read(as_policy_replica replica)
Definition as_command.h:680
static uint8_t * as_command_write_field_uint64(uint8_t *p, uint8_t id, uint64_t val)
Definition as_command.h:431
as_status as_command_compress(as_error *err, uint8_t *cmd, size_t cmd_sz, uint8_t *compressed_cmd, size_t *compressed_size)
as_status as_command_parse_result(as_error *err, as_command *cmd, as_node *node, uint8_t *buf, size_t size)
uint8_t * as_command_parse_key(uint8_t *p, uint32_t n_fields, as_key *key, uint64_t *bval)
as_status as_command_parse_bins(uint8_t **pp, as_error *err, as_record *rec, uint32_t n_bins, bool deserialize)
#define AS_MSG_INFO3_SC_READ_RELAX
Definition as_command.h:96
uint8_t * as_command_write_header_write(uint8_t *cmd, const as_policy_base *policy, as_policy_commit_level commit_level, as_policy_exists exists, as_policy_gen gen_policy, uint32_t gen, uint32_t ttl, uint16_t n_fields, uint16_t n_bins, bool durable_delete, uint8_t read_attr, uint8_t write_attr, uint8_t info_attr)
size_t as_command_user_key_size(const as_key *key)
uint8_t * as_command_write_key(uint8_t *p, as_policy_key policy, const as_key *key)
uint8_t * as_command_ignore_bins(uint8_t *p, uint32_t n_bins)
as_status as_command_parse_success_failure_bins(uint8_t **pp, as_error *err, as_msg *msg, as_val **value)
#define AS_DIGEST_VALUE_SIZE
Definition as_key.h:36
uint8_t as_latency_type
Definition as_latency.h:29
as_operator
uint16_t n_fields
Definition as_proto.h:9
#define AS_COMPRESSED_MESSAGE_TYPE
Definition as_proto.h:39
uint64_t uncompressed_sz
Definition as_proto.h:1
#define AS_PROTO_VERSION
Definition as_proto.h:33
as_proto proto
Definition as_proto.h:0
#define AS_MESSAGE_TYPE
Definition as_proto.h:38
static bool as_queue_pop(as_queue *queue, void *ptr)
Definition as_queue.h:165
AS_EXTERN void as_queue_destroy(as_queue *queue)
static uint64_t as_random_get_uint64(void)
Definition as_random.h:84
as_status
Definition as_status.h:30
@ AEROSPIKE_OK
Definition as_status.h:128
@ AEROSPIKE_ERR_PARAM
Definition as_status.h:109
as_policy_commit_level
Definition as_policy.h:370
as_policy_gen
Definition as_policy.h:172
as_policy_read_mode_sc
Definition as_policy.h:333
as_policy_exists
Definition as_policy.h:236
as_policy_key
Definition as_policy.h:200
as_policy_replica
Definition as_policy.h:272
as_policy_read_mode_ap
Definition as_policy.h:312
@ AS_POLICY_READ_MODE_SC_ALLOW_REPLICA
Definition as_policy.h:351
@ AS_POLICY_READ_MODE_SC_SESSION
Definition as_policy.h:339
@ AS_POLICY_READ_MODE_SC_ALLOW_UNAVAILABLE
Definition as_policy.h:357
@ AS_POLICY_READ_MODE_SC_LINEARIZE
Definition as_policy.h:345
@ AS_POLICY_REPLICA_ANY
Definition as_policy.h:283
@ AS_POLICY_REPLICA_MASTER
Definition as_policy.h:277
@ AS_POLICY_REPLICA_SEQUENCE
Definition as_policy.h:291
@ AS_POLICY_READ_MODE_AP_ALL
Definition as_policy.h:322
uint8_t * data
Definition as_buffer.h:48
uint32_t size
Definition as_buffer.h:43
const as_policy_base * policy
Definition as_command.h:173
const char * ns
Definition as_command.h:175
size_t buf_size
Definition as_command.h:180
uint64_t deadline_ms
Definition as_command.h:183
uint32_t partition_id
Definition as_command.h:181
uint32_t max_retries
Definition as_command.h:186
as_latency_type latency_type
Definition as_command.h:193
uint32_t socket_timeout
Definition as_command.h:184
uint8_t replica_size
Definition as_command.h:190
void * udata
Definition as_command.h:178
uint8_t replica_index
Definition as_command.h:191
as_node * node
Definition as_command.h:174
uint32_t iteration
Definition as_command.h:187
uint8_t flags
Definition as_command.h:189
as_parse_results_fn parse_results_fn
Definition as_command.h:177
uint32_t total_timeout
Definition as_command.h:185
uint8_t replica_index_sc
Definition as_command.h:192
as_cluster * cluster
Definition as_command.h:172
uint8_t * buf
Definition as_command.h:179
as_policy_replica replica
Definition as_command.h:182
void * partition
Definition as_command.h:176
uint32_t sent
Definition as_command.h:188
as_digest_value value
Definition as_key.h:82
uint32_t socket_timeout
Definition as_policy.h:448
uint32_t total_timeout
Definition as_policy.h:463
uint32_t max_retries
Definition as_policy.h:485