Interface TimestampLeaseAwareTransactionManager
-
Method Summary
Modifier and TypeMethodDescriptionlong
getLeasedTimestamp
(com.palantir.atlasdb.common.api.timelock.TimestampLeaseName leaseName) Returns a timestamp that is before any leased timestamps returned by the consumer onTimestampLeaseAwareTransaction.preCommit(TimestampLeaseName, int, PreCommitAction)
for atimestampLeaseName
in open transactions.
-
Method Details
-
getLeasedTimestamp
long getLeasedTimestamp(com.palantir.atlasdb.common.api.timelock.TimestampLeaseName leaseName) Returns a timestamp that is before any leased timestamps returned by the consumer onTimestampLeaseAwareTransaction.preCommit(TimestampLeaseName, int, PreCommitAction)
for atimestampLeaseName
in open transactions.This is similar to
TransactionManager.getImmutableTimestamp()
as it returns a timestamp before timestamps in open transactions, but for the immutable timestamp the timestamps considered are start timestamps for open transactions, while for leased timestamps the timestamps considered are leased timestamps from the correspondingtimestampLeaseName
in open transactions.If no transactions with a
timestampLeaseName
lock are open, this method returns a new fresh timestamp (i.e. equivalent toTimelockService.getFreshTimestamp()
).Consumers should fetch the leased timestamp outside of transactions that potentially use it - if fetching the leased timestamp inside a transaction, it's possible for the transaction's start timestamp < leased timestamp, meaning the transaction cannot read all data up to leased timestamp.
- Parameters:
leaseName
- the name of the lease the timestamps are bound to- Returns:
- the timestamp that is before any timestamp returned by the consumer of
TimestampLeaseAwareTransaction.preCommit(TimestampLeaseName, int, PreCommitAction)
for open transactions.
-