Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data VersionstampCompleteness
- data Versionstamp (a :: VersionstampCompleteness) where
- data TransactionVersionstamp = TransactionVersionstamp Word64 Word16
- putTransactionVersionstamp :: Putter TransactionVersionstamp
- encodeTransactionVersionstamp :: TransactionVersionstamp -> ByteString
- putVersionstamp :: Putter (Versionstamp a)
- encodeVersionstamp :: Versionstamp a -> ByteString
- getTransactionVersionstamp :: Get TransactionVersionstamp
- getVersionstampComplete :: Get (Versionstamp 'Complete)
- decodeVersionstamp :: ByteString -> Maybe (Versionstamp 'Complete)
- decodeTransactionVersionstamp :: ByteString -> Maybe TransactionVersionstamp
Documentation
data VersionstampCompleteness Source #
Represents whether a versionstamp is complete (has been written to FDB and thus contains a full version integer) or incomplete (contains a user-provided version, but has not yet been committed to FDB).
data Versionstamp (a :: VersionstampCompleteness) where Source #
Represents a version stamp. Version stamps consist of * An 8-byte transaction version * A 2-byte transaction batch order * A 2-byte user version
The first ten bytes are assigned by FoundationDB to each transaction in such a way that each transaction is numbered in a serializable order.
The last two bytes can be used by the user to further distinguish between multiple entities or keys that were committed in one transaction.
CompleteVersionstamp :: TransactionVersionstamp -> Word16 -> Versionstamp 'Complete | A complete version stamp, consisting of |
IncompleteVersionstamp :: Word16 -> Versionstamp 'Incomplete | A version stamp that has not yet been associated with a completed transaction. Such a version stamp does not yet have an associated transaction version and transaction batch order, but does have a user version. |
Instances
data TransactionVersionstamp Source #
A TransactionVersionstamp
consists of a monotonically-increasing
8-byte transaction version and a 2-byte transaction batch order. Each
committed transaction has an associated TransactionVersionstamp
.
Instances
putVersionstamp :: Putter (Versionstamp a) Source #
encodeVersionstamp :: Versionstamp a -> ByteString Source #
Encodes a versionstamp into a bytestring. You probably don't need this; see the facilities in FoundationDB.Layer.Tuple for a more flexible alternative.
decodeVersionstamp :: ByteString -> Maybe (Versionstamp 'Complete) Source #
Decode a versionstamp from a raw bytestring. You probably don't need this; see the facilities in FoundationDB.Layer.Tuple for a more flexible alternative.