hce-node application  1.4.3
HCE Hierarchical Cluster Engine node application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
citrusleaf-internal.h
Go to the documentation of this file.
1 /*
2  * The Aerospike C interface. A good, basic library that many clients can be based on.
3  *
4  * This is the external, public header file
5  *
6  * this code currently assumes that the server is running in an ASCII-7 based
7  * (ie, utf8 or ISO-LATIN-1)
8  * character set, as values coming back from the server are UTF-8. We currently
9  * don't bother to convert to the character set of the machine we're running on
10  * but we advertise these values as 'strings'
11  *
12  * All rights reserved
13  * Brian Bulkowski, 2009
14  * CitrusLeaf
15  */
16 
17 #include <inttypes.h>
18 #include <stdbool.h>
19 #include <netinet/in.h>
20 
21 // do this both the new skool and old skool way which gives the highest correctness,
22 // speed, and compatibility
23 #pragma once
24 
25 #include "citrusleaf/citrusleaf.h"
26 #include "citrusleaf/cl_cluster.h"
27 #include "citrusleaf/proto.h"
28 #include "citrusleaf/cf_atomic.h"
29 #include "citrusleaf/cf_ll.h"
30 #include "citrusleaf/cf_vector.h"
31 #include "citrusleaf/cf_queue.h"
32 #include "citrusleaf/cf_alloc.h"
33 #include "citrusleaf/cf_digest.h"
35 
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
39 
40 
41 // citrusleaf.c used by cl_batch
42 int
43 cl_value_to_op_get_size(cl_bin *v, size_t *sz);
44 
45 uint8_t *
46 cl_write_header(uint8_t *buf, size_t msg_sz, uint info1, uint info2, uint info3, uint32_t generation, uint32_t record_ttl, uint32_t transaction_ttl, uint32_t n_fields, uint32_t n_ops );
47 
48 int
49 cl_value_to_op(cl_bin *v, cl_operator clOperator, cl_operation *operation, cl_msg_op *op);
50 
51 void
52 cl_set_value_particular(cl_msg_op *op, cl_bin *value);
53 
55 
56 typedef struct cl_async_work {
57  uint64_t trid; //Transaction-id of the submitted work
58  uint64_t deadline; //Deadline time for this work item
59  uint64_t starttime; //Start time for this work item
60  cl_cluster_node *node; //Node to which the work item was sent
61  int fd; //FD used to send the command asynchronously
62  void *udata;
64 
65 int cl_del_node_asyncworkitems(void *key, void *value, void *clnode);
66 
67 
68 // scan fields
69 // left-to-right bits
70 // 0-3 priority hint = ClScanningPriority
71 // 4 = failOnClusterChange
72 // 5-7 = unused
73 // 8-15 = scan_pct
74  typedef struct cl_scan_param_field_s {
75  uint8_t byte1;
76  uint8_t scan_pct;
78 
79 // For XDS...
80 extern cf_queue *g_cl_async_q;
82 
83 
84 int
85 cl_do_async_monte(cl_cluster *asc, int info1, int info2, const char *ns, const char *set, const cl_object *key,
86  const cf_digest *digest, cl_bin **values, cl_operator operator, cl_operation **operations,
87  int *n_values, uint32_t *cl_gen, const cl_write_parameters *cl_w_p, uint64_t *trid, void *udata);
88 
89 /*
90 int
91 do_the_full_monte(cl_cluster *asc, int info1, int info2, const char *ns, const char *set, const cl_object *key,
92  const cf_digest *digest, cl_bin **values, cl_operator operator, cl_operation **operations,
93  int *n_values, uint32_t *cl_gen, const cl_write_parameters *cl_w_p, uint64_t *trid);
94 
95 int
96 do_many_monte(cl_cluster *asc, uint operation_info, uint operation_info2, const char *ns, const char *set,
97  const cf_digest *digests, int n_digests, citrusleaf_get_many_cb cb, void *udata);
98 
99 int
100 do_async_monte(cl_cluster *asc, int info1, int info2, const char *ns, const char *set, const cl_object *key,
101  const cf_digest *digest, cl_bin **values, cl_operator operator, cl_operation **operations,
102  int *n_values, uint32_t *cl_gen, const cl_write_parameters *cl_w_p, uint64_t *trid, void *udata);
103 */
104 
105 //
106 // cl_batch.c
107 //
108 void
110 
111 void
113 
114 int
115 citrusleaf_info_host_limit(struct sockaddr_in *sa_in, char *names, char **values, int timeout_ms, bool send_asis, uint64_t max_response_length);
116 
117 int
118 cl_compile(uint info1, uint info2, uint info3, const char *ns, const char *set, const cl_object *key, const cf_digest *digest,
119  cl_bin *values, cl_operator operator, cl_operation *operations, int n_values,
120  uint8_t **buf_r, size_t *buf_sz_r, const cl_write_parameters *cl_w_p, cf_digest *d_ret, uint64_t trid, cl_scan_param_field *scan_field);
121 
122 int
123 cl_parse(cl_msg *msg, uint8_t *buf, size_t buf_len, cl_bin **values_r, cl_operation **operations_r,
124  int *n_values_r, uint64_t *trid, char *setname_r);
125 
126 #ifdef DEBUG_VERBOSE
127 void
128 dump_buf(char *info, uint8_t *buf, size_t buf_len);
129 #endif
130 
131 #ifdef __cplusplus
132 } // end extern "C"
133 #endif
134 
135