foundationdb-haskell-0.1.0.0: FoundationDB C client bindings
Safe HaskellNone
LanguageHaskell2010

FoundationDB.Versionstamp

Description

Synopsis

Documentation

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.

Constructors

CompleteVersionstamp :: TransactionVersionstamp -> Word16 -> Versionstamp 'Complete

A complete version stamp, consisting of TransactionVersionstamp, and a user version set by the user.

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.

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).

Constructors

Complete 
Incomplete 

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

Instances details
Bounded TransactionVersionstamp Source # 
Instance details

Defined in FoundationDB.Versionstamp.Internal

Eq TransactionVersionstamp Source # 
Instance details

Defined in FoundationDB.Versionstamp.Internal

Ord TransactionVersionstamp Source # 
Instance details

Defined in FoundationDB.Versionstamp.Internal

Read TransactionVersionstamp Source # 
Instance details

Defined in FoundationDB.Versionstamp.Internal

Show TransactionVersionstamp Source # 
Instance details

Defined in FoundationDB.Versionstamp.Internal

Generic TransactionVersionstamp Source # 
Instance details

Defined in FoundationDB.Versionstamp.Internal

Associated Types

type Rep TransactionVersionstamp :: Type -> Type #

NFData TransactionVersionstamp Source # 
Instance details

Defined in FoundationDB.Versionstamp.Internal

Methods

rnf :: TransactionVersionstamp -> () #

type Rep TransactionVersionstamp Source # 
Instance details

Defined in FoundationDB.Versionstamp.Internal

type Rep TransactionVersionstamp = D1 ('MetaData "TransactionVersionstamp" "FoundationDB.Versionstamp.Internal" "foundationdb-haskell-0.1.0.0-3SdCayabJ4FTICSdqP65r" 'False) (C1 ('MetaCons "TransactionVersionstamp" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word64) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word16)))

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.

transactionVersion :: TransactionVersionstamp -> Word64 Source #

Extracts the transaction version from the versionstamp. This is the database version at which the versionstamp was committed.

transactionBatchOrder :: TransactionVersionstamp -> Word16 Source #

Extracts the batch order from the versionstamp.