@@ -55,7 +55,7 @@ extern "C" {
55
55
#define WSREP_CAP_ENCAPSULATE ( 1ULL << 14 )
56
56
57
57
/*!
58
- * Write set replication flags
58
+ * Writeset flags
59
59
*/
60
60
#define WSREP_FLAG_PA_SAFE ( 1ULL << 0 )
61
61
#define WSREP_FLAG_COMMUTATIVE ( 1ULL << 1 )
@@ -128,14 +128,14 @@ static const wsrep_uuid_t WSREP_UUID_UNDEFINED = {{0,}};
128
128
* Scan UUID from string
129
129
* @return length of UUID string representation or negative error code
130
130
*/
131
- extern ssize_t
131
+ extern int
132
132
wsrep_uuid_scan (const char * str , size_t str_len , wsrep_uuid_t * uuid );
133
133
134
134
/*!
135
135
* Print UUID to string
136
136
* @return length of UUID string representation or negative error code
137
137
*/
138
- extern ssize_t
138
+ extern int
139
139
wsrep_uuid_print (const wsrep_uuid_t * uuid , char * str , size_t str_len );
140
140
141
141
#define WSREP_MEMBER_NAME_LEN 32 //!< maximum logical member name length
@@ -163,14 +163,14 @@ static const wsrep_gtid_t WSREP_GTID_UNDEFINED = {{{0, }}, -1};
163
163
* Scan GTID from string
164
164
* @return length of GTID string representation or negative error code
165
165
*/
166
- extern ssize_t
166
+ extern int
167
167
wsrep_gtid_scan (const char * str , size_t str_len , wsrep_gtid_t * gtid );
168
168
169
169
/*!
170
170
* Print GTID to string
171
171
* @return length of GTID string representation or negative error code
172
172
*/
173
- extern ssize_t
173
+ extern int
174
174
wsrep_gtid_print (const wsrep_gtid_t * gtid , char * str , size_t str_len );
175
175
176
176
/*!
@@ -273,23 +273,23 @@ typedef void (*wsrep_view_cb_t) (void* app_ctx,
273
273
const char * state ,
274
274
size_t state_len ,
275
275
void * * sst_req ,
276
- ssize_t * sst_req_len );
276
+ int * sst_req_len );
277
277
278
278
/*!
279
279
* @brief apply callback
280
280
*
281
- * This handler is called from wsrep library to apply replicated write set
281
+ * This handler is called from wsrep library to apply replicated writeset
282
282
* Must support brute force applying for multi-master operation
283
283
*
284
284
* @param recv_ctx receiver context pointer provided by the application
285
- * @param data data buffer containing the write set
285
+ * @param data data buffer containing the writeset
286
286
* @param size data buffer size
287
- * @param meta transaction meta data of the write set to be applied
287
+ * @param meta transaction meta data of the writeset to be applied
288
288
*
289
289
* @return success code:
290
290
* @retval WSREP_OK
291
- * @retval WSREP_NOT_IMPLEMENTED appl. does not support the write set format
292
- * @retval WSREP_ERROR failed to apply the write set
291
+ * @retval WSREP_NOT_IMPLEMENTED appl. does not support the writeset format
292
+ * @retval WSREP_ERROR failed to apply the writeset
293
293
*/
294
294
typedef enum wsrep_status (* wsrep_apply_cb_t ) (
295
295
void * recv_ctx ,
@@ -303,7 +303,7 @@ typedef enum wsrep_status (*wsrep_apply_cb_t) (
303
303
* This handler is called to commit the changes made by apply callback.
304
304
*
305
305
* @param recv_ctx receiver context pointer provided by the application
306
- * @param meta transaction meta data of the write set to be committed
306
+ * @param meta transaction meta data of the writeset to be committed
307
307
* @param commit true - commit writeset, false - rollback writeset
308
308
*
309
309
* @return success code:
@@ -322,7 +322,7 @@ typedef enum wsrep_status (*wsrep_commit_cb_t) (
322
322
* to be executed in any particular order) attached to writeset.
323
323
*
324
324
* @param recv_ctx receiver context pointer provided by the application
325
- * @param data data buffer containing the write set
325
+ * @param data data buffer containing the writeset
326
326
* @param size data buffer size
327
327
*
328
328
* @return success code:
@@ -436,20 +436,20 @@ struct wsrep_stats_var
436
436
typedef struct wsrep_buf
437
437
{
438
438
const void * ptr ; /*!< Pointer to data buffer */
439
- size_t len ; /*!< Length of buffer */
439
+ int len ; /*!< Length of buffer (2G max) */
440
440
} wsrep_buf_t ;
441
441
442
442
/*! Key struct used to pass certification keys for transaction handling calls.
443
443
* A key consists of zero or more key parts. */
444
444
typedef struct wsrep_key
445
445
{
446
446
const wsrep_buf_t * key_parts ; /*!< Array of key parts */
447
- long key_parts_num ; /*!< Number of key parts */
447
+ int key_parts_num ; /*!< Number of key parts */
448
448
} wsrep_key_t ;
449
449
450
450
/*! Key type:
451
451
* EXCLUSIVE conflicts with any key type
452
- * SEMI reserved. If not supported, will be interpeted as EXCLUSIVE
452
+ * SEMI reserved. If not supported, should be interpeted as EXCLUSIVE
453
453
* SHARED conflicts only with EXCLUSIVE keys */
454
454
typedef enum wsrep_key_type
455
455
{
@@ -458,6 +458,19 @@ typedef enum wsrep_key_type
458
458
WSREP_KEY_EXCLUSIVE
459
459
} wsrep_key_type_t ;
460
460
461
+ /*! Data type:
462
+ * ORDERED state modification event that should be applied and committed
463
+ * in order.
464
+ * UNORDERED some action that does not modify state and execution of which is
465
+ * optional and does not need to happen in order.
466
+ * ANNOTATION (human readable) writeset annotation. */
467
+ typedef enum wsrep_data_type
468
+ {
469
+ WSREP_DATA_ORDERED = 0 ,
470
+ WSREP_DATA_UNORDERED ,
471
+ WSREP_DATA_ANNOTATION
472
+ } wsrep_data_type_t ;
473
+
461
474
/*! Transaction handle struct passed for wsrep transaction handling calls */
462
475
typedef struct wsrep_ws_handle_
463
476
{
@@ -596,7 +609,7 @@ struct wsrep_ {
596
609
wsrep_conn_id_t conn_id ,
597
610
wsrep_ws_handle_t * ws_handle ,
598
611
// const struct wsrep_buf* data,
599
- // long count,
612
+ // int count,
600
613
uint64_t flags ,
601
614
wsrep_trx_meta_t * meta );
602
615
@@ -623,11 +636,11 @@ struct wsrep_ {
623
636
wsrep_ws_handle_t * ws_handle );
624
637
625
638
/*!
626
- * @brief Replay trx as a slave write set
639
+ * @brief Replay trx as a slave writeset
627
640
*
628
641
* If local trx has been aborted by brute force, and it has already
629
642
* replicated before this abort, we must try if we can apply it as
630
- * slave trx. Note that slave nodes see only trx write sets and certification
643
+ * slave trx. Note that slave nodes see only trx writesets and certification
631
644
* test based on write set content can be different to DBMS lock conflicts.
632
645
*
633
646
* @param wsrep provider handle
@@ -666,67 +679,46 @@ struct wsrep_ {
666
679
wsrep_trx_id_t victim_trx );
667
680
668
681
/*!
669
- * @brief Appends a row reference to transaction write set
682
+ * @brief Appends a row reference to transaction writeset
670
683
*
671
684
* Both copy flag and key_type can be ignored by provider (key type
672
685
* interpreted as WSREP_KEY_EXCLUSIVE).
673
686
*
674
687
* @param wsrep provider handle
675
688
* @param ws_handle writeset handle
676
689
* @param keys array of keys
677
- * @param keys_num length of the array of keys
678
- * @param copy can be set to FALSE if keys persist until commit.
679
- * @param shared boolean denoting if key corresponds to shared resource
690
+ * @param count length of the array of keys
691
+ * @param type type ot the key
692
+ * @param copy can be set to FALSE if keys persist through commit.
680
693
*/
681
694
wsrep_status_t (* append_key )(wsrep_t * wsrep ,
682
695
wsrep_ws_handle_t * ws_handle ,
683
696
const wsrep_key_t * keys ,
684
- long keys_num ,
685
- wsrep_key_type_t key_type ,
697
+ int count ,
698
+ enum wsrep_key_type type ,
686
699
wsrep_bool_t copy );
687
700
688
701
/*!
689
- * @brief Appends data to transaction write set
702
+ * @brief Appends data to transaction writeset
690
703
*
691
704
* This method can be called any time before commit and it
692
- * appends a number of data buffers to transaction write set .
705
+ * appends a number of data buffers to transaction writeset .
693
706
*
694
707
* Both copy and unordered flags can be ignored by provider.
695
708
*
696
709
* @param wsrep provider handle
697
710
* @param ws_handle writeset handle
698
711
* @param data array of data buffers
699
712
* @param count buffer count
700
- * @param copy can be set to FALSE if data persists until commit.
701
- * @param unordered can be set to TRUE if this part of the write set
702
- * executed out of order.
713
+ * @param type type of data
714
+ * @param copy can be set to FALSE if data persists through commit.
703
715
*/
704
716
wsrep_status_t (* append_data )(wsrep_t * wsrep ,
705
717
wsrep_ws_handle_t * ws_handle ,
706
718
const struct wsrep_buf * data ,
707
- long count ,
708
- wsrep_bool_t copy ,
709
- wsrep_bool_t unordered );
710
-
711
- /*!
712
- * @brief Appends (human readable) annotation to transaction write set
713
- *
714
- * This method can be called any time before commit and it
715
- * appends array of strings to transaction write set.
716
- *
717
- * Copy flag can be ignored by provider.
718
- *
719
- * @param wsrep provider handle
720
- * @param ws_handle writeset handle
721
- * @param annotation array of annotation strings
722
- * @param count annotation string count
723
- * @param copy can be set to FALSE if data persists until commit.
724
- */
725
- wsrep_status_t (* annotate )(wsrep_t * wsrep ,
726
- wsrep_ws_handle_t * ws_handle ,
727
- const char * annotation [],
728
- long count ,
729
- wsrep_bool_t copy );
719
+ int count ,
720
+ enum wsrep_data_type type ,
721
+ wsrep_bool_t copy );
730
722
731
723
/*!
732
724
* @brief Get causal ordering for read operation
@@ -779,9 +771,9 @@ struct wsrep_ {
779
771
wsrep_status_t (* to_execute_start )(wsrep_t * wsrep ,
780
772
wsrep_conn_id_t conn_id ,
781
773
const wsrep_key_t * keys ,
782
- long keys_num ,
774
+ int keys_num ,
783
775
const struct wsrep_buf * action ,
784
- long count ,
776
+ int count ,
785
777
wsrep_trx_meta_t * meta );
786
778
787
779
/*!
@@ -824,7 +816,7 @@ struct wsrep_ {
824
816
const wsrep_uuid_t * source_id ,
825
817
int pa_range ,
826
818
const struct wsrep_buf * data ,
827
- long count ,
819
+ int count ,
828
820
wsrep_bool_t copy );
829
821
830
822
/*!
@@ -872,7 +864,7 @@ struct wsrep_ {
872
864
*/
873
865
wsrep_status_t (* snapshot )(wsrep_t * wsrep ,
874
866
const void * msg ,
875
- size_t msg_len ,
867
+ int msg_len ,
876
868
const char * donor_spec );
877
869
878
870
/*!
0 commit comments