mirror of https://github.com/tikv/client-rust.git
				
				
				
			Add method of gettimestamp for transaction (#303)
* add interface of timestamp Signed-off-by: Little-Wallace <bupt2013211450@gmail.com> * fix comment Signed-off-by: Little-Wallace <bupt2013211450@gmail.com> * Update src/transaction/transaction.rs Co-authored-by: Andy Lok <andylokandy@hotmail.com> Signed-off-by: Little-Wallace <bupt2013211450@gmail.com> Co-authored-by: Andy Lok <andylokandy@hotmail.com> Co-authored-by: Ziqian Qin <ekexium@gmail.com>
This commit is contained in:
		
							parent
							
								
									dc793a519b
								
							
						
					
					
						commit
						ccf8a2c15d
					
				|  | @ -183,7 +183,9 @@ impl Client { | |||
| 
 | ||||
|     /// Request garbage collection (GC) of the TiKV cluster.
 | ||||
|     ///
 | ||||
|     /// GC deletes MVCC records whose timestamp is lower than the given `safepoint`.
 | ||||
|     /// GC deletes MVCC records whose timestamp is lower than the given `safepoint`. We must guarantee
 | ||||
|     ///  that all transactions started before this timestamp had committed. We can keep an active
 | ||||
|     /// transaction list in application to decide which is the minimal start timestamp of them.
 | ||||
|     ///
 | ||||
|     /// For each key, the last mutation record (unless it's a deletion) before `safepoint` is retained.
 | ||||
|     ///
 | ||||
|  |  | |||
|  | @ -635,6 +635,11 @@ impl<PdC: PdClient> Transaction<PdC> { | |||
|         res | ||||
|     } | ||||
| 
 | ||||
|     /// Get the start timestamp of this transaction.
 | ||||
|     pub fn start_timestamp(&self) -> Timestamp { | ||||
|         self.timestamp.clone() | ||||
|     } | ||||
| 
 | ||||
|     /// Send a heart beat message to keep the transaction alive on the server and update its TTL.
 | ||||
|     ///
 | ||||
|     /// Returns the TTL set on the transaction's locks by TiKV.
 | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue