Documentation ¶
Index ¶
- type ManualAPI
- type Option
- func WithACKTimeout(value time.Duration) Option
- func WithCell(value *cedis.Cedis) Option
- func WithCommitIfAllBranchSucceedInPhaseOne(value bool) Option
- func WithConcurrency(concurrency int) Option
- func WithElector(value election.Elector) Option
- func WithElectorOptions(value ...election.Option) Option
- func WithIDGenerator(value id.Generator) Option
- func WithResourceLock(lock lock.ResourceLock) Option
- func WithRetries(value int) Option
- func WithStatusChangeAware(becomeLeader, becomeFollower func()) Option
- func WithTransactionTimeout(value time.Duration) Option
- type QueryAPI
- type TransactionCoordinator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ManualAPI ¶
type ManualAPI interface { // Commit commit global transaction Commit(fid, gid uint64) error // Rollback rollback global transaction Rollback(fid, gid uint64) error }
ManualAPI manual api
func NewcellManualAPI ¶
NewcellManualAPI returns query API
type Option ¶
type Option func(*options)
Option option
func WithACKTimeout ¶
WithACKTimeout set ackTimeout times
func WithCommitIfAllBranchSucceedInPhaseOne ¶
WithCommitIfAllBranchSucceedInPhaseOne set commitIfAllBranchSucceedInPhaseOne
func WithElectorOptions ¶
WithElectorOptions set leader elector options
func WithIDGenerator ¶
WithIDGenerator set id generator
func WithResourceLock ¶
func WithResourceLock(lock lock.ResourceLock) Option
WithResourceLock set resource lock value
func WithStatusChangeAware ¶
func WithStatusChangeAware(becomeLeader, becomeFollower func()) Option
WithStatusChangeAware set leader follow handler
func WithTransactionTimeout ¶
WithTransactionTimeout set transaction timeout
type QueryAPI ¶
type QueryAPI interface { // CountTransactions returns transaction count CountTransactions(fid uint64) (uint64, error) // Transactions returns a transaction list Transactions(fid uint64, query meta.Query) ([]meta.GlobalTransaction, error) // Transaction returns the spec transaction Transaction(fid uint64, gid uint64) (*meta.GlobalTransaction, error) }
QueryAPI query api
func NewCellQueryAPI ¶
NewCellQueryAPI returns query API
type TransactionCoordinator ¶
type TransactionCoordinator interface { // Stop stop tc Stop() // ActiveGCount returns number of the actived global transaction ActiveGCount() int // IsLeader returns true if current node is leader IsLeader() bool // ChangeLeaderTo change leader to the spec peer ChangeLeaderTo(id uint64) // CurrentLeader returns the current leader CurrentLeader() (uint64, error) // RegistryGlobalTransaction registry a global transaction RegistryGlobalTransaction(value meta.CreateGlobalTransaction, cb func(uint64, error)) // RegistryBranchTransaction registry a branch transaction RegistryBranchTransaction(value meta.CreateBranchTransaction, cb func(uint64, error)) // ReportBranchTransactionStatus report branch transaction status, phase one ReportBranchTransactionStatus(value meta.ReportBranchStatus, cb func(error)) // GlobalTransactionStatus return global status GlobalTransactionStatus(gid uint64, cb func(meta.GlobalStatus, error)) // CommitGlobalTransaction commit global CommitGlobalTransaction(gid uint64, who string, cb func(meta.GlobalStatus, error)) // RollbackGlobalTransaction rollback global RollbackGlobalTransaction(gid uint64, who string, cb func(meta.GlobalStatus, error)) // BranchTransactionNotifyACK branch transaction commit/rollback result ack BranchTransactionNotifyACK(ack meta.NotifyACK) // Lockable returns true if can be locked Lockable(resource string, gid uint64, lockKeys []meta.LockKey, cb func(bool, error)) }
TransactionCoordinator Taas transaction manager
func NewCellTransactionCoordinator ¶
func NewCellTransactionCoordinator(id, peerID uint64, trans transport.Transport, opts ...Option) (TransactionCoordinator, error)
NewCellTransactionCoordinator create a transaction coordinator used Elasticell with meta storage
Source Files ¶
Click to show internal directories.
Click to hide internal directories.