|
8 | 8 |
|
9 | 9 | #defineINVALID_XID 0
|
10 | 10 |
|
11 |
| -// Sets up the host and port for DTM connection. |
12 |
| -// The defaults are "127.0.0.1" and 5431. |
| 11 | +/** |
| 12 | + * Sets up the host and port for DTM connection. |
| 13 | + * The defaults are "127.0.0.1" and 5431. |
| 14 | + */ |
13 | 15 | voidDtmGlobalConfig(char*host,intport,char*sock_dir);
|
14 | 16 |
|
15 | 17 | voidDtmInitSnapshot(Snapshotsnapshot);
|
16 | 18 |
|
17 |
| -// Starts a new global transaction. Returns the |
18 |
| -// transaction id, fills the 'snapshot' and 'gxmin' on success. 'gxmin' is the |
19 |
| -// smallest xmin among all snapshots known to DTM. Returns INVALID_XID |
20 |
| -// otherwise. |
| 19 | +/** |
| 20 | + * Starts a new global transaction. Returns the |
| 21 | + * transaction id, fills the 'snapshot' and 'gxmin' on success. 'gxmin' is the |
| 22 | + * smallest xmin among all snapshots known to DTM. Returns INVALID_XID |
| 23 | + * otherwise. |
| 24 | + */ |
21 | 25 | TransactionIdDtmGlobalStartTransaction(Snapshotsnapshot,TransactionId*gxmin);
|
22 | 26 |
|
23 |
| -// Asks the DTM for a fresh snapshot. Fills the 'snapshot' and 'gxmin' on |
24 |
| -// success. 'gxmin' is the smallest xmin among all snapshots known to DTM. |
| 27 | +/** |
| 28 | + * Asks the DTM for a fresh snapshot. Fills the 'snapshot' and 'gxmin' on |
| 29 | + * success. 'gxmin' is the smallest xmin among all snapshots known to DTM. |
| 30 | + */ |
25 | 31 | voidDtmGlobalGetSnapshot(TransactionIdxid,Snapshotsnapshot,TransactionId*gxmin);
|
26 | 32 |
|
27 |
| -// Commits transaction only once all participants have called this function, |
28 |
| -// does not change CLOG otherwise. Set 'wait' to 'true' if you want this call |
29 |
| -// to return only after the transaction is considered finished by the DTM. |
30 |
| -// Returns the status on success, or -1 otherwise. |
| 33 | +/** |
| 34 | + * Commits transaction only once all participants have called this function, |
| 35 | + * does not change CLOG otherwise. Set 'wait' to 'true' if you want this call |
| 36 | + * to return only after the transaction is considered finished by the DTM. |
| 37 | + * Returns the status on success, or -1 otherwise. |
| 38 | + */ |
31 | 39 | XidStatusDtmGlobalSetTransStatus(TransactionIdxid,XidStatusstatus,boolwait);
|
32 | 40 |
|
33 |
| -// Gets the status of the transaction identified by 'xid'. Returns the status |
34 |
| -// on success, or -1 otherwise. If 'wait' is true, then it does not return |
35 |
| -// until the transaction is finished. |
| 41 | +/** |
| 42 | + * Gets the status of the transaction identified by 'xid'. Returns the status |
| 43 | + * on success, or -1 otherwise. If 'wait' is true, then it does not return |
| 44 | + * until the transaction is finished. |
| 45 | + */ |
36 | 46 | XidStatusDtmGlobalGetTransStatus(TransactionIdxid,boolwait);
|
37 | 47 |
|
38 |
| -// Reserves at least 'nXids' successive xids for local transactions. The xids |
39 |
| -// reserved are not less than 'xid' in value. Returns the actual number of xids |
40 |
| -// reserved, and sets the 'first' xid accordingly. The number of xids reserved |
41 |
| -// is guaranteed to be at least nXids. |
42 |
| -// In other words, *first ≥ xid and result ≥ nXids. |
| 48 | +/** |
| 49 | + * Reserves at least 'nXids' successive xids for local transactions. The xids |
| 50 | + * reserved are not less than 'xid' in value. Returns the actual number of xids |
| 51 | + * reserved, and sets the 'first' xid accordingly. The number of xids reserved |
| 52 | + * is guaranteed to be at least nXids. |
| 53 | + * In other words, *first ≥ xid and result ≥ nXids. |
| 54 | + */ |
43 | 55 | intDtmGlobalReserve(TransactionIdxid,intnXids,TransactionId*first);
|
44 | 56 |
|
| 57 | +/** |
| 58 | + * Detect global deadlock. This funcions send serialized local resource graph to arbiter which appends them to global graph. |
| 59 | + * Once loop is detected in global resoruce graph, arbiter returns true. Otherwise false is returned. |
| 60 | + * Abiter should replace local part of resource graph if new graph is recevied from this cluster node (not backend). |
| 61 | + */ |
| 62 | +boolDtmGlobalDetectDeadLock(void*graph,intsize); |
| 63 | + |
45 | 64 | #endif
|