Skip to content

Commit 3ba8939

Browse files
committed
Cosmetic change: renamed trx_handle -> ws_handle which is more semantically correct and goes in like with "wsrep" acronym.
1 parent 564e116 commit 3ba8939

File tree

2 files changed

+33
-33
lines changed

2 files changed

+33
-33
lines changed

wsrep_api.h

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -459,29 +459,29 @@ typedef enum wsrep_key_type
459459
} wsrep_key_type_t;
460460

461461
/*! Transaction handle struct passed for wsrep transaction handling calls */
462-
typedef struct wsrep_trx_handle_
462+
typedef struct wsrep_ws_handle_
463463
{
464464
wsrep_trx_id_t trx_id; //!< transaction ID
465465
void* opaque; //!< opaque provider transaction context data
466-
} wsrep_trx_handle_t;
466+
} wsrep_ws_handle_t;
467467

468468
/*!
469-
* @brief Helper method to reset trx handle state when trx id changes
469+
* @brief Helper method to reset trx writeset handle state when trx id changes
470470
*
471-
* Instead of passing wsrep_trx_handle_t directly to wsrep calls,
471+
* Instead of passing wsrep_ws_handle_t directly to wsrep calls,
472472
* wrapping handle with this call offloads bookkeeping from
473473
* application.
474474
*/
475-
static inline wsrep_trx_handle_t* wsrep_trx_handle_for_id(
476-
wsrep_trx_handle_t* trx_handle,
477-
wsrep_trx_id_t trx_id)
475+
static inline wsrep_ws_handle_t* wsrep_ws_handle_for_trx(
476+
wsrep_ws_handle_t* ws_handle,
477+
wsrep_trx_id_t trx_id)
478478
{
479-
if (trx_handle->trx_id != trx_id)
479+
if (ws_handle->trx_id != trx_id)
480480
{
481-
trx_handle->trx_id = trx_id;
482-
trx_handle->opaque = NULL;
481+
ws_handle->trx_id = trx_id;
482+
ws_handle->opaque = NULL;
483483
}
484-
return trx_handle;
484+
return ws_handle;
485485
}
486486

487487
typedef struct wsrep_ wsrep_t;
@@ -580,7 +580,7 @@ struct wsrep_ {
580580
* commit. Otherwise transaction must rollback.
581581
*
582582
* @param wsrep provider handle
583-
* @param trx_handle transaction which is committing
583+
* @param ws_handle writeset of committing transaction
584584
* @param conn_id connection ID
585585
// * @param data array of application data buffers
586586
// * @param count buffer count
@@ -594,7 +594,7 @@ struct wsrep_ {
594594
*/
595595
wsrep_status_t (*pre_commit)(wsrep_t* wsrep,
596596
wsrep_conn_id_t conn_id,
597-
wsrep_trx_handle_t* trx_handle,
597+
wsrep_ws_handle_t* ws_handle,
598598
// const struct wsrep_buf* data,
599599
// long count,
600600
uint64_t flags,
@@ -606,21 +606,21 @@ struct wsrep_ {
606606
* Ends commit critical section.
607607
*
608608
* @param wsrep provider handle
609-
* @param trx_handle transaction which is committing
609+
* @param ws_handle writeset of committing transaction
610610
* @retval WSREP_OK post_commit succeeded
611611
*/
612612
wsrep_status_t (*post_commit) (wsrep_t* wsrep,
613-
wsrep_trx_handle_t* trx_handle);
613+
wsrep_ws_handle_t* ws_handle);
614614

615615
/*!
616616
* @brief Releases resources after transaction rollback.
617617
*
618618
* @param wsrep provider handle
619-
* @param trx_handle transaction which is committing
619+
* @param ws_handle writeset of committing transaction
620620
* @retval WSREP_OK post_rollback succeeded
621621
*/
622622
wsrep_status_t (*post_rollback)(wsrep_t* wsrep,
623-
wsrep_trx_handle_t* trx_handle);
623+
wsrep_ws_handle_t* ws_handle);
624624

625625
/*!
626626
* @brief Replay trx as a slave write set
@@ -631,7 +631,7 @@ struct wsrep_ {
631631
* test based on write set content can be different to DBMS lock conflicts.
632632
*
633633
* @param wsrep provider handle
634-
* @param trx_handle transaction which is committing
634+
* @param ws_handle writeset of committing transaction
635635
* @param trx_ctx transaction context
636636
*
637637
* @retval WSREP_OK cluster commit succeeded
@@ -642,7 +642,7 @@ struct wsrep_ {
642642
* @retval WSREP_NODE_FAIL must close all connections and reinit
643643
*/
644644
wsrep_status_t (*replay_trx)(wsrep_t* wsrep,
645-
wsrep_trx_handle_t* trx_handle,
645+
wsrep_ws_handle_t* ws_handle,
646646
void* trx_ctx);
647647

648648
/*!
@@ -672,14 +672,14 @@ struct wsrep_ {
672672
* interpreted as WSREP_KEY_EXCLUSIVE).
673673
*
674674
* @param wsrep provider handle
675-
* @param trx_handle transaction handle
675+
* @param ws_handle writeset handle
676676
* @param keys array of keys
677677
* @param keys_num length of the array of keys
678678
* @param copy can be set to FALSE if keys persist until commit.
679679
* @param shared boolean denoting if key corresponds to shared resource
680680
*/
681681
wsrep_status_t (*append_key)(wsrep_t* wsrep,
682-
wsrep_trx_handle_t* trx_handle,
682+
wsrep_ws_handle_t* ws_handle,
683683
const wsrep_key_t* keys,
684684
long keys_num,
685685
wsrep_key_type_t key_type,
@@ -689,20 +689,20 @@ struct wsrep_ {
689689
* @brief Appends data to transaction write set
690690
*
691691
* This method can be called any time before commit and it
692-
* appends data block into transaction's write set.
692+
* appends a number of data buffers to transaction write set.
693693
*
694694
* Both copy and unordered flags can be ignored by provider.
695695
*
696696
* @param wsrep provider handle
697-
* @param trx_handle transaction handle
697+
* @param ws_handle writeset handle
698698
* @param data array of data buffers
699699
* @param count buffer count
700700
* @param copy can be set to FALSE if data persists until commit.
701701
* @param unordered can be set to TRUE if this part of the write set
702702
* executed out of order.
703703
*/
704704
wsrep_status_t (*append_data)(wsrep_t* wsrep,
705-
wsrep_trx_handle_t* trx_handle,
705+
wsrep_ws_handle_t* ws_handle,
706706
const struct wsrep_buf* data,
707707
long count,
708708
wsrep_bool_t copy,
@@ -717,13 +717,13 @@ struct wsrep_ {
717717
* Copy flag can be ignored by provider.
718718
*
719719
* @param wsrep provider handle
720-
* @param trx_handle transaction handle
720+
* @param ws_handle writeset handle
721721
* @param annotation array of annotation strings
722722
* @param count annotation string count
723723
* @param copy can be set to FALSE if data persists until commit.
724724
*/
725725
wsrep_status_t (*annotate)(wsrep_t* wsrep,
726-
wsrep_trx_handle_t* trx_handle,
726+
wsrep_ws_handle_t* ws_handle,
727727
const char* annotation[],
728728
long count,
729729
wsrep_bool_t copy);

wsrep_dummy.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ static wsrep_status_t dummy_recv(wsrep_t* w,
100100
static wsrep_status_t dummy_pre_commit(
101101
wsrep_t* w,
102102
const wsrep_conn_id_t conn_id __attribute__((unused)),
103-
wsrep_trx_handle_t* trx_handle __attribute__((unused)),
103+
wsrep_ws_handle_t* ws_handle __attribute__((unused)),
104104
// const struct wsrep_buf* data __attribute__((unused)),
105105
// const long count __attribute__((unused)),
106106
uint64_t flags __attribute__((unused)),
@@ -112,23 +112,23 @@ static wsrep_status_t dummy_pre_commit(
112112

113113
static wsrep_status_t dummy_post_commit(
114114
wsrep_t* w,
115-
wsrep_trx_handle_t* trx_handle __attribute__((unused)))
115+
wsrep_ws_handle_t* ws_handle __attribute__((unused)))
116116
{
117117
WSREP_DBUG_ENTER(w);
118118
return WSREP_OK;
119119
}
120120

121121
static wsrep_status_t dummy_post_rollback(
122122
wsrep_t* w,
123-
wsrep_trx_handle_t* trx_handle __attribute__((unused)))
123+
wsrep_ws_handle_t* ws_handle __attribute__((unused)))
124124
{
125125
WSREP_DBUG_ENTER(w);
126126
return WSREP_OK;
127127
}
128128

129129
static wsrep_status_t dummy_replay_trx(
130130
wsrep_t* w,
131-
wsrep_trx_handle_t* trx_handle __attribute__((unused)),
131+
wsrep_ws_handle_t* ws_handle __attribute__((unused)),
132132
void* trx_ctx __attribute__((unused)))
133133
{
134134
WSREP_DBUG_ENTER(w);
@@ -146,7 +146,7 @@ static wsrep_status_t dummy_abort_pre_commit(
146146

147147
static wsrep_status_t dummy_append_key(
148148
wsrep_t* w,
149-
wsrep_trx_handle_t* trx_handle __attribute__((unused)),
149+
wsrep_ws_handle_t* ws_handle __attribute__((unused)),
150150
const wsrep_key_t* key __attribute__((unused)),
151151
const long key_num __attribute__((unused)),
152152
const wsrep_key_type_t key_type __attribute__((unused)),
@@ -158,7 +158,7 @@ static wsrep_status_t dummy_append_key(
158158

159159
static wsrep_status_t dummy_append_data(
160160
wsrep_t* w,
161-
wsrep_trx_handle_t* trx_handle __attribute__((unused)),
161+
wsrep_ws_handle_t* ws_handle __attribute__((unused)),
162162
const struct wsrep_buf* data __attribute__((unused)),
163163
const long count __attribute__((unused)),
164164
const bool copy __attribute__((unused)),
@@ -170,7 +170,7 @@ static wsrep_status_t dummy_append_data(
170170

171171
static wsrep_status_t dummy_annotate(
172172
wsrep_t* w,
173-
wsrep_trx_handle_t* trx_handle __attribute__((unused)),
173+
wsrep_ws_handle_t* ws_handle __attribute__((unused)),
174174
const char** annotation __attribute__((unused)),
175175
const long count __attribute__((unused)),
176176
const bool copy __attribute__((unused)))

0 commit comments

Comments
 (0)