Documentation ¶
Index ¶
- Constants
- Variables
- func MaybeReadBigString(buf *goetty.ByteBuf) (string, bool)
- func MaybeReadString(buf *goetty.ByteBuf) (string, bool)
- func ReadBigString(buf *goetty.ByteBuf) string
- func ReadBool(in *goetty.ByteBuf) bool
- func ReadByte(buf *goetty.ByteBuf) byte
- func ReadBytes(n int, buf *goetty.ByteBuf) []byte
- func ReadInt(buf *goetty.ByteBuf) int
- func ReadPeer(in *goetty.ByteBuf) prophet.Peer
- func ReadPeers(in *goetty.ByteBuf) []prophet.Peer
- func ReadSlice(buf *goetty.ByteBuf) []byte
- func ReadString(buf *goetty.ByteBuf) string
- func ReadUInt16(buf *goetty.ByteBuf) uint16
- func ReadUInt64(buf *goetty.ByteBuf) uint64
- func TagBranchTransaction(gid, bid uint64, action string) string
- func TagGlobalTransaction(gid uint64, action string) string
- func WriteBigString(value string, buf *goetty.ByteBuf)
- func WriteBool(value bool, out *goetty.ByteBuf)
- func WritePeer(peer prophet.Peer, out *goetty.ByteBuf)
- func WritePeers(peers []prophet.Peer, out *goetty.ByteBuf)
- func WriteSlice(value []byte, buf *goetty.ByteBuf)
- func WriteString(value string, buf *goetty.ByteBuf)
- func WriteXID(value FragmentXID, buf *goetty.ByteBuf)
- type Action
- type BranchCommitRequest
- type BranchCommitResponse
- func (msg *BranchCommitResponse) BatchEncode(buf *goetty.ByteBuf)
- func (msg *BranchCommitResponse) Decode(buf *goetty.ByteBuf)
- func (msg *BranchCommitResponse) Encode() *goetty.ByteBuf
- func (msg *BranchCommitResponse) MaybeDecode(buf *goetty.ByteBuf) bool
- func (msg *BranchCommitResponse) Type() uint16
- type BranchRegisterRequest
- func (msg *BranchRegisterRequest) BatchEncode(buf *goetty.ByteBuf)
- func (msg *BranchRegisterRequest) Decode(buf *goetty.ByteBuf)
- func (msg *BranchRegisterRequest) Encode() *goetty.ByteBuf
- func (msg *BranchRegisterRequest) ToCreateBranchTransaction(rmSID string) (CreateBranchTransaction, error)
- func (msg *BranchRegisterRequest) Type() uint16
- type BranchRegisterResponse
- func (msg *BranchRegisterResponse) BatchEncode(buf *goetty.ByteBuf)
- func (msg *BranchRegisterResponse) Decode(buf *goetty.ByteBuf)
- func (msg *BranchRegisterResponse) Encode() *goetty.ByteBuf
- func (msg *BranchRegisterResponse) MaybeDecode(buf *goetty.ByteBuf) bool
- func (msg *BranchRegisterResponse) Type() uint16
- type BranchReportRequest
- func (msg *BranchReportRequest) BatchEncode(buf *goetty.ByteBuf)
- func (msg *BranchReportRequest) Decode(buf *goetty.ByteBuf)
- func (msg *BranchReportRequest) Encode() *goetty.ByteBuf
- func (msg *BranchReportRequest) ToReportBranchStatus(rmSID string) ReportBranchStatus
- func (msg *BranchReportRequest) Type() uint16
- type BranchReportResponse
- func (msg *BranchReportResponse) BatchEncode(buf *goetty.ByteBuf)
- func (msg *BranchReportResponse) Decode(buf *goetty.ByteBuf)
- func (msg *BranchReportResponse) Encode() *goetty.ByteBuf
- func (msg *BranchReportResponse) MaybeDecode(buf *goetty.ByteBuf) bool
- func (msg *BranchReportResponse) Type() uint16
- type BranchRollbackRequest
- func (msg *BranchRollbackRequest) BatchEncode(buf *goetty.ByteBuf)
- func (msg *BranchRollbackRequest) Decode(buf *goetty.ByteBuf)
- func (msg *BranchRollbackRequest) Encode() *goetty.ByteBuf
- func (msg *BranchRollbackRequest) MaybeDecode(buf *goetty.ByteBuf) bool
- func (msg *BranchRollbackRequest) Type() uint16
- type BranchRollbackResponse
- func (msg *BranchRollbackResponse) BatchEncode(buf *goetty.ByteBuf)
- func (msg *BranchRollbackResponse) Decode(buf *goetty.ByteBuf)
- func (msg *BranchRollbackResponse) Encode() *goetty.ByteBuf
- func (msg *BranchRollbackResponse) MaybeDecode(buf *goetty.ByteBuf) bool
- func (msg *BranchRollbackResponse) Type() uint16
- type BranchStatus
- type BranchTransaction
- type BranchType
- type CreateBranchTransaction
- type CreateGlobalTransaction
- type Error
- type Fragment
- type FragmentXID
- type GlobalBeginRequest
- func (msg *GlobalBeginRequest) BatchEncode(buf *goetty.ByteBuf)
- func (msg *GlobalBeginRequest) Decode(buf *goetty.ByteBuf)
- func (msg *GlobalBeginRequest) Encode() *goetty.ByteBuf
- func (msg *GlobalBeginRequest) ToCreateGlobalTransaction(creator, proxy string) CreateGlobalTransaction
- func (msg *GlobalBeginRequest) Type() uint16
- type GlobalBeginResponse
- type GlobalCommitRequest
- type GlobalCommitResponse
- type GlobalLockQueryRequest
- type GlobalLockQueryResponse
- func (msg *GlobalLockQueryResponse) BatchEncode(buf *goetty.ByteBuf)
- func (msg *GlobalLockQueryResponse) Decode(buf *goetty.ByteBuf)
- func (msg *GlobalLockQueryResponse) Encode() *goetty.ByteBuf
- func (msg *GlobalLockQueryResponse) MaybeDecode(buf *goetty.ByteBuf) bool
- func (msg *GlobalLockQueryResponse) Type() uint16
- type GlobalRollbackRequest
- type GlobalRollbackResponse
- type GlobalStatus
- type GlobalStatusRequest
- type GlobalStatusResponse
- type GlobalTransaction
- type HBACKMsg
- type HBMsg
- type Header
- type HeartbeatMessage
- type JSONResult
- type LockKey
- type Manual
- type MergeResultMessage
- type MergedWarpMessage
- type Message
- type Notify
- type NotifyACK
- type Query
- type RPCMessage
- type RegisterRMRequest
- func (msg *RegisterRMRequest) BatchEncode(buf *goetty.ByteBuf)
- func (msg *RegisterRMRequest) Decode(buf *goetty.ByteBuf)
- func (msg *RegisterRMRequest) Encode() *goetty.ByteBuf
- func (msg *RegisterRMRequest) MaybeDecode(buf *goetty.ByteBuf) bool
- func (msg *RegisterRMRequest) ToResourceSet(proxySID, rmSID string) ResourceManagerSet
- func (msg *RegisterRMRequest) Type() uint16
- type RegisterRMResponse
- type RegisterTMRequest
- type RegisterTMResponse
- type RemoveMsg
- type ReportBranchStatus
- type ResourceManager
- type ResourceManagerSet
- type RetryNotLeaderMessage
- type RouteableMessage
- type StoreMeta
- type Summary
Constants ¶
const ( // FlagRequest flag request FlagRequest uint16 = 0x80 // FlagAsync flag async FlagAsync uint16 = 0x40 // FlagHeartbeat flag hb FlagHeartbeat uint16 = 0x20 // FlagSeataCodec seata codec FlagSeataCodec uint16 = 0x10 )
const ( // NoneAction none action NoneAction = Action(0) // RollbackAction rollback action RollbackAction = Action(1) // CommitAction commit action CommitAction = Action(2) )
const ( // TypeHeartbeat msg type TypeHeartbeat uint16 = 0 // TypeGlobalBegin msg type TypeGlobalBegin uint16 = 1 // TypeGlobalBeginResult msg type TypeGlobalBeginResult uint16 = 2 // TypeBranchCommit msg type TypeBranchCommit uint16 = 3 // TypeBranchCommitResult msg type TypeBranchCommitResult uint16 = 4 // TypeBranchRollback msg type TypeBranchRollback uint16 = 5 // TypeBranchRollbackResult msg type TypeBranchRollbackResult uint16 = 6 // TypeGlobalCommit msg type TypeGlobalCommit uint16 = 7 // TypeGlobalCommitResult msg type TypeGlobalCommitResult uint16 = 8 // TypeGlobalRollback msg type TypeGlobalRollback uint16 = 9 // TypeGlobalRollbackResult msg type TypeGlobalRollbackResult uint16 = 10 // TypeBranchRegister msg type TypeBranchRegister uint16 = 11 // TypeBranchRegisterResult msg type TypeBranchRegisterResult uint16 = 12 // TypeBranchStatusReport msg type TypeBranchStatusReport uint16 = 13 // TypeBranchStatusReportResult msg type TypeBranchStatusReportResult uint16 = 14 // TypeGlobalStatus msg type TypeGlobalStatus uint16 = 15 // TypeGlobalStatusResult msg type TypeGlobalStatusResult uint16 = 16 // TypeGlobalLockQuery msg type TypeGlobalLockQuery uint16 = 21 // TypeGlobalLockQueryResult msg type TypeGlobalLockQueryResult uint16 = 22 // TypeSeataMerge msg type TypeSeataMerge uint16 = 59 // TypeSeataMergeResult msg type TypeSeataMergeResult uint16 = 60 // TypeRegClt msg type TypeRegClt uint16 = 101 // TypeRegCltResult msg type TypeRegCltResult uint16 = 102 // TypeRegRM msg type TypeRegRM uint16 = 103 // TypeRegRMResult msg type TypeRegRMResult uint16 = 104 // TypeRetryNotLeader for sharding TypeRetryNotLeader uint16 = math.MaxUint16 )
Variables ¶
var ( // SeataDecoder seata decoder SeataDecoder = fc // SeataEncoder seata encoder SeataEncoder = fc // SeataHB heartbeat msg SeataHB = &HeartbeatMessage{} )
var ( // ProxyDecoder proxy routeable message decoder ProxyDecoder = goetty.NewIntLengthFieldBasedDecoder(pc) // ProxyEncoder proxy routeable message encoder ProxyEncoder = goetty.NewIntLengthFieldBasedEncoder(pc) )
var ( // ShardingEncoder sharding encode ShardingEncoder = goetty.NewIntLengthFieldBasedEncoder(&shardingCodec{}) // ShardingDecoder sharding decoder ShardingDecoder = goetty.NewIntLengthFieldBasedDecoder(&shardingCodec{}) )
var ( // ErrUnknown Unknown err ErrUnknown = newError(0) // ErrLockKeyConflict LockKeyConflict err ErrLockKeyConflict = newError(1) // ErrIO io err ErrIO = newError(2) // ErrBranchRollbackFailedRetryable BranchRollbackFailedRetryable err ErrBranchRollbackFailedRetryable = newError(3) // ErrBranchRollbackFailedUnretryable BranchRollbackFailedUnRetryable err ErrBranchRollbackFailedUnretryable = newError(4) // ErrBranchRegisterFailed BranchRegisterFailed err ErrBranchRegisterFailed = newError(5) // ErrBranchReportFailed BranchReportFailed err ErrBranchReportFailed = newError(6) // ErrLockableCheckFailed LockableCheckFailed Err ErrLockableCheckFailed = newError(7) // ErrBranchTransactionNotExist BranchTransactionNotExist err ErrBranchTransactionNotExist = newError(8) // ErrGlobalTransactionNotExist GlobalTransactionNotExist err ErrGlobalTransactionNotExist = newError(9) // ErrGlobalTransactionNotActive GlobalTransactionNotActive err ErrGlobalTransactionNotActive = newError(10) // ErrGlobalTransactionStatusInvalid GlobalTransactionStatusInvalid err ErrGlobalTransactionStatusInvalid = newError(11) // ErrFailedToSendBranchCommitRequest FailedToSendBranchCommitRequest err ErrFailedToSendBranchCommitRequest = newError(12) // ErrFailedToSendBranchRollbackRequest FailedToSendBranchRollbackRequest err ErrFailedToSendBranchRollbackRequest = newError(13) // ErrFailedToAddBranch FailedToAddBranch err ErrFailedToAddBranch = newError(14) // ErrNotLeader errors is not leader ErrNotLeader = errors.New("is not leader") )
var ( // AT auto transaction AT = BranchType(0) // TCC manual transaction TCC = BranchType(1) )
var ( // BranchStatusUnknown Unknown BranchStatusUnknown = BranchStatus(0) // BranchStatusRegistered Registered to TC BranchStatusRegistered = BranchStatus(1) // BranchStatusPhaseOneDone Branch logic is successfully done at phase one BranchStatusPhaseOneDone = BranchStatus(2) // BranchStatusPhaseOneFailed Branch logic is failed at phase one BranchStatusPhaseOneFailed = BranchStatus(3) // BranchStatusPhaseOneTimeout Branch logic is NOT reported for a timeout BranchStatusPhaseOneTimeout = BranchStatus(4) // BranchStatusPhaseTwoCommitted Commit logic is succeed done at phase two BranchStatusPhaseTwoCommitted = BranchStatus(5) // BranchStatusPhaseTwoCommitFailedRetriable Commit logic is failed but retriable. BranchStatusPhaseTwoCommitFailedRetriable = BranchStatus(6) // BranchStatusPhaseTwoCommitFailedUnretriable Commit logic is failed and NOT retryable. BranchStatusPhaseTwoCommitFailedUnretriable = BranchStatus(7) // BranchStatusPhaseTwoRollbacked logic is rollback succeed done at phase two. BranchStatusPhaseTwoRollbacked = BranchStatus(8) // BranchStatusPhaseTwoRollbackFailedRetriable Rollback logic is failed but retriable. BranchStatusPhaseTwoRollbackFailedRetriable = BranchStatus(9) // BranchStatusPhaseTwoRollbackFailedUnretriable Rollback logic is failed but NOT retriable. BranchStatusPhaseTwoRollbackFailedUnretriable = BranchStatus(10) )
var ( // GlobalStatusUnKnown Unknown GlobalStatusUnKnown = GlobalStatus(0) // GlobalStatusBegin PHASE 1: can accept new branch registering. GlobalStatusBegin = GlobalStatus(1) // GlobalStatusCommitting Committing. GlobalStatusCommitting = GlobalStatus(2) // GlobalStatusRetryCommitting Retrying commit after a recoverable failure. GlobalStatusRetryCommitting = GlobalStatus(3) // GlobalStatusRollbacking Rollbacking GlobalStatusRollbacking = GlobalStatus(4) // GlobalStatusRetryRollbacking Retrying rollback after a recoverable failure. GlobalStatusRetryRollbacking = GlobalStatus(5) // GlobalStatusRollbackingSinceTimeout Rollbacking since timeout GlobalStatusRollbackingSinceTimeout = GlobalStatus(6) // GlobalStatusRetryRollbackingSinceTimeout Retrying rollback (since timeout) after a recoverable failure. GlobalStatusRetryRollbackingSinceTimeout = GlobalStatus(7) // GlobalStatusCommitted Finally: global transaction is successfully committed. GlobalStatusCommitted = GlobalStatus(8) // GlobalStatusCommitFailed Finally: failed to commit GlobalStatusCommitFailed = GlobalStatus(9) // GlobalStatusRollbacked Finally: global transaction is successfully rollbacked. GlobalStatusRollbacked = GlobalStatus(10) // GlobalStatusRollbackFailed Finally: failed to rollback GlobalStatusRollbackFailed = GlobalStatus(11) // GlobalStatusRollbackedSinceTimeout Finally: global transaction is successfully rollbacked since timeout. GlobalStatusRollbackedSinceTimeout = GlobalStatus(12) // GlobalStatusRollbackFailedSinceTimeout Finally: failed to rollback since timeout GlobalStatusRollbackFailedSinceTimeout = GlobalStatus(13) // GlobalStatusFinished Not managed in session map any more GlobalStatusFinished = GlobalStatus(14) )
var ( // EmptyQuery empty query EmptyQuery = Query{Status: -1, Action: -1} )
Functions ¶
func MaybeReadBigString ¶
MaybeReadBigString maybe read string value
func MaybeReadString ¶
MaybeReadString maybe read string value
func TagBranchTransaction ¶
TagBranchTransaction reutrns a branch transaction
func TagGlobalTransaction ¶
TagGlobalTransaction reutrns a global transaction
func WriteBigString ¶
WriteBigString write big string
func WriteString ¶
WriteString write string value
Types ¶
type BranchCommitRequest ¶
type BranchCommitRequest struct {
// contains filtered or unexported fields
}
BranchCommitRequest commit branch request
func AcquireBranchCommitRequest ¶
func AcquireBranchCommitRequest() *BranchCommitRequest
AcquireBranchCommitRequest acquire a value from pool
func (*BranchCommitRequest) BatchEncode ¶
BatchEncode batch encode
func (*BranchCommitRequest) Decode ¶
Decode decode message from byte buffer
func (*BranchCommitRequest) Encode ¶
Encode encode message
func (*BranchCommitRequest) MaybeDecode ¶
MaybeDecode maybe decode message from byte buffer
func (*BranchCommitRequest) Type ¶
func (msg *BranchCommitRequest) Type() uint16
Type returns message type
type BranchCommitResponse ¶
type BranchCommitResponse struct {
// contains filtered or unexported fields
}
BranchCommitResponse commit a branch transaction response
func AcquireBranchCommitResponse ¶
func AcquireBranchCommitResponse() *BranchCommitResponse
AcquireBranchCommitResponse acquire a value from pool
func (*BranchCommitResponse) BatchEncode ¶
func (*BranchCommitResponse) Decode ¶
Decode decode message from byte buffer
func (*BranchCommitResponse) Encode ¶
Encode encode message
func (*BranchCommitResponse) MaybeDecode ¶
MaybeDecode maybe decode message from byte buffer
func (*BranchCommitResponse) Type ¶
func (msg *BranchCommitResponse) Type() uint16
Type returns message type
type BranchRegisterRequest ¶
type BranchRegisterRequest struct { XID FragmentXID BranchType BranchType ResourceID string LockKey string // table1:pk1,pk2;table2:pk1,pk2 ApplicationData string }
BranchRegisterRequest register a branch request
func AcquireBranchRegisterRequest ¶
func AcquireBranchRegisterRequest() *BranchRegisterRequest
AcquireBranchRegisterRequest acquire a value from pool
func (*BranchRegisterRequest) BatchEncode ¶
func (msg *BranchRegisterRequest) BatchEncode(buf *goetty.ByteBuf)
BatchEncode batch encode
func (*BranchRegisterRequest) Decode ¶
func (msg *BranchRegisterRequest) Decode(buf *goetty.ByteBuf)
Decode decode message from byte buffer
func (*BranchRegisterRequest) Encode ¶
func (msg *BranchRegisterRequest) Encode() *goetty.ByteBuf
Encode encode message
func (*BranchRegisterRequest) ToCreateBranchTransaction ¶
func (msg *BranchRegisterRequest) ToCreateBranchTransaction(rmSID string) (CreateBranchTransaction, error)
ToCreateBranchTransaction adapter method to createBranchTransaction
func (*BranchRegisterRequest) Type ¶
func (msg *BranchRegisterRequest) Type() uint16
Type returns message type
type BranchRegisterResponse ¶
type BranchRegisterResponse struct { BranchID uint64 // contains filtered or unexported fields }
BranchRegisterResponse register a branch transaction response
func AcquireBranchRegisterResponse ¶
func AcquireBranchRegisterResponse() *BranchRegisterResponse
AcquireBranchRegisterResponse acquire a value from pool
func (*BranchRegisterResponse) BatchEncode ¶
func (msg *BranchRegisterResponse) BatchEncode(buf *goetty.ByteBuf)
BatchEncode encode message
func (*BranchRegisterResponse) Decode ¶
func (msg *BranchRegisterResponse) Decode(buf *goetty.ByteBuf)
Decode decode message from byte buffer
func (*BranchRegisterResponse) Encode ¶
func (msg *BranchRegisterResponse) Encode() *goetty.ByteBuf
Encode encode message
func (*BranchRegisterResponse) MaybeDecode ¶
MaybeDecode decode message from byte buffer
func (*BranchRegisterResponse) Type ¶
func (msg *BranchRegisterResponse) Type() uint16
Type returns message type
type BranchReportRequest ¶
type BranchReportRequest struct { XID FragmentXID BranchID uint64 BranchType BranchType ResourceID string BranchStatus BranchStatus ApplicationData string }
BranchReportRequest branch transaction report request
func AcquireBranchReportRequest ¶
func AcquireBranchReportRequest() *BranchReportRequest
AcquireBranchReportRequest acquire a value from pool
func (*BranchReportRequest) BatchEncode ¶
func (msg *BranchReportRequest) BatchEncode(buf *goetty.ByteBuf)
BatchEncode batch encode
func (*BranchReportRequest) Decode ¶
func (msg *BranchReportRequest) Decode(buf *goetty.ByteBuf)
Decode decode message from byte buffer
func (*BranchReportRequest) Encode ¶
func (msg *BranchReportRequest) Encode() *goetty.ByteBuf
Encode encode message
func (*BranchReportRequest) ToReportBranchStatus ¶
func (msg *BranchReportRequest) ToReportBranchStatus(rmSID string) ReportBranchStatus
ToReportBranchStatus adapter method
func (*BranchReportRequest) Type ¶
func (msg *BranchReportRequest) Type() uint16
Type returns message type
type BranchReportResponse ¶
type BranchReportResponse struct {
// contains filtered or unexported fields
}
BranchReportResponse report branch transaction status response
func AcquireBranchReportResponse ¶
func AcquireBranchReportResponse() *BranchReportResponse
AcquireBranchReportResponse acquire a value from pool
func (*BranchReportResponse) BatchEncode ¶
BatchEncode encode message
func (*BranchReportResponse) Decode ¶
func (msg *BranchReportResponse) Decode(buf *goetty.ByteBuf)
Decode decode message from byte buffer
func (*BranchReportResponse) Encode ¶
BatchEncode encode message
func (*BranchReportResponse) MaybeDecode ¶
MaybeDecode decode message from byte buffer
func (*BranchReportResponse) Type ¶
func (msg *BranchReportResponse) Type() uint16
Type returns message type
type BranchRollbackRequest ¶
type BranchRollbackRequest struct {
// contains filtered or unexported fields
}
BranchRollbackRequest rollback branch request
func AcquireBranchRollbackRequest ¶
func AcquireBranchRollbackRequest() *BranchRollbackRequest
AcquireBranchRollbackRequest acquire a value from pool
func (*BranchRollbackRequest) BatchEncode ¶
BatchEncode batch encode
func (*BranchRollbackRequest) Decode ¶
Decode decode message from byte buffer
func (*BranchRollbackRequest) Encode ¶
Encode encode message
func (*BranchRollbackRequest) MaybeDecode ¶
MaybeDecode maybe decode message from byte buffer
func (*BranchRollbackRequest) Type ¶
func (msg *BranchRollbackRequest) Type() uint16
Type returns message type
type BranchRollbackResponse ¶
type BranchRollbackResponse struct {
// contains filtered or unexported fields
}
BranchRollbackResponse rollback a branch transaction response
func AcquireBranchRollbackResponse ¶
func AcquireBranchRollbackResponse() *BranchRollbackResponse
AcquireBranchRollbackResponse acquire a value from pool
func (*BranchRollbackResponse) BatchEncode ¶
func (*BranchRollbackResponse) Decode ¶
Decode decode message from byte buffer
func (*BranchRollbackResponse) Encode ¶
Encode encode message
func (*BranchRollbackResponse) MaybeDecode ¶
MaybeDecode maybe decode message from byte buffer
func (*BranchRollbackResponse) Type ¶
func (msg *BranchRollbackResponse) Type() uint16
Type returns message type
type BranchTransaction ¶
type BranchTransaction struct { ID uint64 `json:"id"` GID uint64 `json:"g"` RMSID string `json:"r"` Resource string `json:"rs"` LockKeys []LockKey `json:"l"` StartAt int64 `json:"s"` ReportAt int64 `json:"ra"` NotifyAt int64 `json:"na"` Status BranchStatus `json:"st"` BranchType BranchType `json:"bt"` StartAtTime time.Time `json:"-"` ReportAtTime time.Time `json:"-"` NotifyAtTime time.Time `json:"-"` }
BranchTransaction branch transaction
func (*BranchTransaction) Complete ¶
func (bt *BranchTransaction) Complete() bool
Complete is branch transaction complete
func (*BranchTransaction) PhaseOneCommitted ¶
func (bt *BranchTransaction) PhaseOneCommitted() bool
PhaseOneCommitted is branch transaction has been comitted at phase one
type CreateBranchTransaction ¶
type CreateBranchTransaction struct { ResourceID string `json:"resourceId"` RMSID string `json:"rmSid"` GID uint64 `json:"gid"` LockKeys []LockKey `json:"lockKeys"` BranchType BranchType `json:"branchType"` }
CreateBranchTransaction create a branch transaction
type CreateGlobalTransaction ¶
type CreateGlobalTransaction struct { Name string `json:"name"` Creator string `json:"creator"` Proxy string `json:"proxy"` Timeout time.Duration `json:"timeout,omitempty"` }
CreateGlobalTransaction create a global
type Fragment ¶
type Fragment struct { ID uint64 `json:"id"` Peers []prophet.Peer `json:"peers"` Version uint64 `json:"version"` DisableGrow bool `json:"disableGrow"` }
Fragment A shard is a logical processing unit. Each shard handles a certain number of global transactions. Exceeding the processing power of the logical unit, a new shard is generated to process.
type FragmentXID ¶
FragmentXID fragment xid
func MaybeReadXID ¶
func MaybeReadXID(buf *goetty.ByteBuf) (FragmentXID, bool)
MaybeReadXID maybe read xid value
func NewFragmentXID ¶
func NewFragmentXID(gid, fid uint64) FragmentXID
NewFragmentXID returns fragment xid
type GlobalBeginRequest ¶
GlobalBeginRequest begin a global request
func AcquireGlobalBeginRequest ¶
func AcquireGlobalBeginRequest() *GlobalBeginRequest
AcquireGlobalBeginRequest acquire a value from pool
func (*GlobalBeginRequest) BatchEncode ¶
func (msg *GlobalBeginRequest) BatchEncode(buf *goetty.ByteBuf)
BatchEncode encode message
func (*GlobalBeginRequest) Decode ¶
func (msg *GlobalBeginRequest) Decode(buf *goetty.ByteBuf)
Decode decode message from byte buffer
func (*GlobalBeginRequest) Encode ¶
func (msg *GlobalBeginRequest) Encode() *goetty.ByteBuf
Encode encode message
func (*GlobalBeginRequest) ToCreateGlobalTransaction ¶
func (msg *GlobalBeginRequest) ToCreateGlobalTransaction(creator, proxy string) CreateGlobalTransaction
ToCreateGlobalTransaction returns create info
func (*GlobalBeginRequest) Type ¶
func (msg *GlobalBeginRequest) Type() uint16
Type returns message type
type GlobalBeginResponse ¶
type GlobalBeginResponse struct { XID FragmentXID ExtraData string // contains filtered or unexported fields }
GlobalBeginResponse begin a global transaction response
func AcquireGlobalBeginResponse ¶
func AcquireGlobalBeginResponse() *GlobalBeginResponse
AcquireGlobalBeginResponse acquire a value from pool
func (*GlobalBeginResponse) BatchEncode ¶
func (msg *GlobalBeginResponse) BatchEncode(buf *goetty.ByteBuf)
BatchEncode encode message
func (*GlobalBeginResponse) Decode ¶
func (msg *GlobalBeginResponse) Decode(buf *goetty.ByteBuf)
Decode decode message from byte buffer
func (*GlobalBeginResponse) Encode ¶
func (msg *GlobalBeginResponse) Encode() *goetty.ByteBuf
Encode encode message
func (*GlobalBeginResponse) MaybeDecode ¶
MaybeDecode decode message from byte buffer
func (*GlobalBeginResponse) Type ¶
func (msg *GlobalBeginResponse) Type() uint16
Type returns message type
type GlobalCommitRequest ¶
type GlobalCommitRequest struct {
// contains filtered or unexported fields
}
GlobalCommitRequest commit global transaction request
func AcquireGlobalCommitRequest ¶
func AcquireGlobalCommitRequest() *GlobalCommitRequest
AcquireGlobalCommitRequest acquire a value from pool
func (*GlobalCommitRequest) BatchEncode ¶
BatchEncode batch encode
func (*GlobalCommitRequest) Decode ¶
Decode decode message from byte buffer
func (*GlobalCommitRequest) Encode ¶
Encode encode message
func (*GlobalCommitRequest) Type ¶
func (msg *GlobalCommitRequest) Type() uint16
Type returns message type
type GlobalCommitResponse ¶
type GlobalCommitResponse struct {
// contains filtered or unexported fields
}
GlobalCommitResponse commit a global transaction response
func AcquireGlobalCommitResponse ¶
func AcquireGlobalCommitResponse() *GlobalCommitResponse
AcquireGlobalCommitResponse acquire a value from pool
func (*GlobalCommitResponse) BatchEncode ¶
BatchEncode encode message
func (*GlobalCommitResponse) Decode ¶
Decode decode message from byte buffer
func (*GlobalCommitResponse) Encode ¶
Encode encode message
func (*GlobalCommitResponse) Type ¶
func (msg *GlobalCommitResponse) Type() uint16
Type returns message type
type GlobalLockQueryRequest ¶
type GlobalLockQueryRequest struct {
BranchRegisterRequest
}
GlobalLockQueryRequest query global lock request
func AcquireGlobalLockQueryRequest ¶
func AcquireGlobalLockQueryRequest() *GlobalLockQueryRequest
AcquireGlobalLockQueryRequest acquire a value from pool
func (*GlobalLockQueryRequest) Type ¶
func (msg *GlobalLockQueryRequest) Type() uint16
Type returns message type
type GlobalLockQueryResponse ¶
type GlobalLockQueryResponse struct { Lockable bool // contains filtered or unexported fields }
GlobalLockQueryResponse query global lock response
func AcquireGlobalLockQueryResponse ¶
func AcquireGlobalLockQueryResponse() *GlobalLockQueryResponse
AcquireGlobalLockQueryResponse acquire a value from pool
func (*GlobalLockQueryResponse) BatchEncode ¶
func (msg *GlobalLockQueryResponse) BatchEncode(buf *goetty.ByteBuf)
BatchEncode encode message
func (*GlobalLockQueryResponse) Decode ¶
func (msg *GlobalLockQueryResponse) Decode(buf *goetty.ByteBuf)
Decode decode message from byte buffer
func (*GlobalLockQueryResponse) Encode ¶
func (msg *GlobalLockQueryResponse) Encode() *goetty.ByteBuf
Encode encode message
func (*GlobalLockQueryResponse) MaybeDecode ¶
MaybeDecode decode message from byte buffer
func (*GlobalLockQueryResponse) Type ¶
func (msg *GlobalLockQueryResponse) Type() uint16
Type returns message type
type GlobalRollbackRequest ¶
type GlobalRollbackRequest struct {
// contains filtered or unexported fields
}
GlobalRollbackRequest rollback global transaction request
func AcquireGlobalRollbackRequest ¶
func AcquireGlobalRollbackRequest() *GlobalRollbackRequest
AcquireGlobalRollbackRequest acquire a value from pool
func (*GlobalRollbackRequest) BatchEncode ¶
BatchEncode batch encode
func (*GlobalRollbackRequest) Decode ¶
Decode decode message from byte buffer
func (*GlobalRollbackRequest) Encode ¶
Encode encode message
func (*GlobalRollbackRequest) Type ¶
func (msg *GlobalRollbackRequest) Type() uint16
Type returns message type
type GlobalRollbackResponse ¶
type GlobalRollbackResponse struct {
// contains filtered or unexported fields
}
GlobalRollbackResponse rollback a global transaction response
func AcquireGlobalRollbackResponse ¶
func AcquireGlobalRollbackResponse() *GlobalRollbackResponse
AcquireGlobalRollbackResponse acquire a value from pool
func (*GlobalRollbackResponse) BatchEncode ¶
BatchEncode encode message
func (*GlobalRollbackResponse) Decode ¶
Decode decode message from byte buffer
func (*GlobalRollbackResponse) Encode ¶
Encode encode message
func (*GlobalRollbackResponse) Type ¶
func (msg *GlobalRollbackResponse) Type() uint16
Type returns message type
type GlobalStatusRequest ¶
type GlobalStatusRequest struct {
// contains filtered or unexported fields
}
GlobalStatusRequest global status request
func AcquireGlobalStatusRequest ¶
func AcquireGlobalStatusRequest() *GlobalStatusRequest
AcquireGlobalStatusRequest acquire a value from pool
func (*GlobalStatusRequest) BatchEncode ¶
BatchEncode batch encode
func (*GlobalStatusRequest) Decode ¶
Decode decode message from byte buffer
func (*GlobalStatusRequest) Encode ¶
Encode encode message
func (*GlobalStatusRequest) Type ¶
func (msg *GlobalStatusRequest) Type() uint16
Type returns message type
type GlobalStatusResponse ¶
type GlobalStatusResponse struct {
// contains filtered or unexported fields
}
GlobalStatusResponse global status response
func AcquireGlobalStatusResponse ¶
func AcquireGlobalStatusResponse() *GlobalStatusResponse
AcquireGlobalStatusResponse acquire a value from pool
func (*GlobalStatusResponse) BatchEncode ¶
BatchEncode encode message
func (*GlobalStatusResponse) Decode ¶
Decode decode message from byte buffer
func (*GlobalStatusResponse) Encode ¶
Encode encode message
func (*GlobalStatusResponse) Type ¶
func (msg *GlobalStatusResponse) Type() uint16
Type returns message type
type GlobalTransaction ¶
type GlobalTransaction struct { ID uint64 `json:"id"` Name string `json:"n"` Timeout int64 `json:"t"` Creator string `json:"c"` Proxy string `json:"p"` StartAt int64 `json:"s"` StartAtTime time.Time `json:"-"` Status GlobalStatus `json:"st"` Action Action `json:"a"` Branches []*BranchTransaction `json:"bs"` }
GlobalTransaction global transaction
func (*GlobalTransaction) Auto ¶
func (t *GlobalTransaction) Auto() bool
Auto returns if all branches is auto
func (*GlobalTransaction) Complete ¶
func (t *GlobalTransaction) Complete() bool
Complete returns true if in global is already complete
func (*GlobalTransaction) MissingReportB ¶
func (t *GlobalTransaction) MissingReportB() []uint64
MissingReportB returns branches that not report phase_1 status
func (*GlobalTransaction) Reported ¶
func (t *GlobalTransaction) Reported() bool
Reported returns if all branch transaction report phase_1 status
func (*GlobalTransaction) TimeoutStatus ¶
func (t *GlobalTransaction) TimeoutStatus() bool
TimeoutStatus returns true if in timeout status
type HBACKMsg ¶
HBACKMsg sharding hb ack message
type Header ¶
Header seata message header
type HeartbeatMessage ¶
type HeartbeatMessage struct { }
HeartbeatMessage heart
func (*HeartbeatMessage) BatchEncode ¶
func (msg *HeartbeatMessage) BatchEncode(buf *goetty.ByteBuf)
BatchEncode encode message
func (*HeartbeatMessage) Decode ¶
func (msg *HeartbeatMessage) Decode(buf *goetty.ByteBuf)
Decode decode message from byte buffer
func (*HeartbeatMessage) Encode ¶
func (msg *HeartbeatMessage) Encode() *goetty.ByteBuf
Encode encode message
type JSONResult ¶
type JSONResult struct { Code int `json:"code"` Value interface{} `json:"value,omitempty"` }
JSONResult json result
type Manual ¶
Manual manual schedule
type MergeResultMessage ¶
type MergeResultMessage struct {
Msgs []Message
}
MergeResultMessage merge message result
func AcquireMergeResultMessage ¶
func AcquireMergeResultMessage() *MergeResultMessage
AcquireMergeResultMessage acquire a value from pool
func (*MergeResultMessage) BatchEncode ¶
func (msg *MergeResultMessage) BatchEncode(buf *goetty.ByteBuf)
BatchEncode encode message
func (*MergeResultMessage) Decode ¶
func (msg *MergeResultMessage) Decode(buf *goetty.ByteBuf)
Decode decode message from byte buffer
func (*MergeResultMessage) Encode ¶
func (msg *MergeResultMessage) Encode() *goetty.ByteBuf
Encode encode message
func (*MergeResultMessage) Type ¶
func (msg *MergeResultMessage) Type() uint16
Type returns message type
type MergedWarpMessage ¶
MergedWarpMessage branch transaction report request
func AcquireMergedWarpMessage ¶
func AcquireMergedWarpMessage() *MergedWarpMessage
AcquireMergedWarpMessage acquire a value from pool
func (*MergedWarpMessage) BatchEncode ¶
func (msg *MergedWarpMessage) BatchEncode(buf *goetty.ByteBuf)
BatchEncode batch encode
func (*MergedWarpMessage) Decode ¶
func (msg *MergedWarpMessage) Decode(buf *goetty.ByteBuf)
Decode decode message from byte buffer
func (*MergedWarpMessage) Encode ¶
func (msg *MergedWarpMessage) Encode() *goetty.ByteBuf
Encode encode message
func (*MergedWarpMessage) Type ¶
func (msg *MergedWarpMessage) Type() uint16
Type returns message type
type Message ¶
type Message interface { Type() uint16 Decode(buf *goetty.ByteBuf) Encode() *goetty.ByteBuf BatchEncode(*goetty.ByteBuf) }
Message message
type Notify ¶
type Notify struct { Resource string `json:"r"` XID FragmentXID `json:"x"` BID uint64 `json:"b"` Action Action `json:"a"` BranchType BranchType `json:"t"` // contains filtered or unexported fields }
Notify notify
type NotifyACK ¶
type NotifyACK struct { From string `json:"f"` GID uint64 `json:"g"` BID uint64 `json:"b"` Status BranchStatus `json:"s"` Succeed bool `json:"su"` // contains filtered or unexported fields }
NotifyACK notify ack
type Query ¶
type Query struct { Limit uint64 `json:"limit"` After uint64 `json:"after,omitempty"` Name string `json:"name,omitempty"` Status int `json:"status,omitempty"` Action int `json:"action,omitempty"` }
Query query condition
func (*Query) Filter ¶
func (q *Query) Filter(value *GlobalTransaction) bool
Filter filter by conditions
type RPCMessage ¶
RPCMessage seata rpc message
func AcquireRPCMessage ¶
func AcquireRPCMessage() *RPCMessage
AcquireRPCMessage acquire a value from pool
func AcquireRPCMessageForResponse ¶
func AcquireRPCMessageForResponse(msg *RPCMessage, body Message) *RPCMessage
AcquireRPCMessageForResponse acquire a value from pool
func AcquireRPCMessageForResponseByMsgID ¶
func AcquireRPCMessageForResponseByMsgID(msgID uint64, body Message) *RPCMessage
AcquireRPCMessageForResponseByMsgID acquire a value from pool
type RegisterRMRequest ¶
type RegisterRMRequest struct { ResourceIDs string // contains filtered or unexported fields }
RegisterRMRequest register RM request
func AcquireRegisterRMRequest ¶
func AcquireRegisterRMRequest() *RegisterRMRequest
AcquireRegisterRMRequest acquire a value from pool
func (*RegisterRMRequest) BatchEncode ¶
func (msg *RegisterRMRequest) BatchEncode(buf *goetty.ByteBuf)
BatchEncode batch encode
func (*RegisterRMRequest) Decode ¶
func (msg *RegisterRMRequest) Decode(buf *goetty.ByteBuf)
Decode decode message from byte buffer
func (*RegisterRMRequest) Encode ¶
func (msg *RegisterRMRequest) Encode() *goetty.ByteBuf
Encode encode message
func (*RegisterRMRequest) MaybeDecode ¶
func (msg *RegisterRMRequest) MaybeDecode(buf *goetty.ByteBuf) bool
MaybeDecode decode message from byte buffer
func (*RegisterRMRequest) ToResourceSet ¶
func (msg *RegisterRMRequest) ToResourceSet(proxySID, rmSID string) ResourceManagerSet
ToResourceSet returns resource manager set
func (*RegisterRMRequest) Type ¶
func (msg *RegisterRMRequest) Type() uint16
Type returns message type
type RegisterRMResponse ¶
type RegisterRMResponse struct {
// contains filtered or unexported fields
}
RegisterRMResponse register RM response
func AcquireRegisterRMResponse ¶
func AcquireRegisterRMResponse() *RegisterRMResponse
AcquireRegisterRMResponse acquire a value from pool
func (*RegisterRMResponse) BatchEncode ¶
BatchEncode encode message
func (*RegisterRMResponse) Decode ¶
Decode decode message from byte buffer
func (*RegisterRMResponse) Encode ¶
Encode encode message
func (*RegisterRMResponse) MaybeDecode ¶
MaybeDecode decode message from byte buffer
func (*RegisterRMResponse) Type ¶
func (msg *RegisterRMResponse) Type() uint16
Type returns message type
type RegisterTMRequest ¶
type RegisterTMRequest struct {
// contains filtered or unexported fields
}
RegisterTMRequest register TM request
func AcquireRegisterTMRequest ¶
func AcquireRegisterTMRequest() *RegisterTMRequest
AcquireRegisterTMRequest acquire a value from pool
func (*RegisterTMRequest) BatchEncode ¶
BatchEncode batch encode
func (*RegisterTMRequest) Decode ¶
Decode decode message from byte buffer
func (*RegisterTMRequest) Encode ¶
Encode encode message
func (*RegisterTMRequest) MaybeDecode ¶
MaybeDecode maybe decode message from byte buffer
func (*RegisterTMRequest) Type ¶
func (msg *RegisterTMRequest) Type() uint16
Type returns message type
type RegisterTMResponse ¶
type RegisterTMResponse struct {
// contains filtered or unexported fields
}
RegisterTMResponse register TM response
func AcquireRegisterTMResponse ¶
func AcquireRegisterTMResponse() *RegisterTMResponse
AcquireRegisterTMResponse acquire a value from pool
func (*RegisterTMResponse) BatchEncode ¶
BatchEncode encode message
func (*RegisterTMResponse) Decode ¶
Decode decode message from byte buffer
func (*RegisterTMResponse) Encode ¶
Encode encode message
func (*RegisterTMResponse) MaybeDecode ¶
MaybeDecode decode message from byte buffer
func (*RegisterTMResponse) Type ¶
func (msg *RegisterTMResponse) Type() uint16
Type returns message type
type ReportBranchStatus ¶
type ReportBranchStatus struct { ResourceID string `json:"resourceId"` GID uint64 `json:"gid"` BID uint64 `json:"bid"` Status BranchStatus `json:"status"` RMSID string `json:"from"` }
ReportBranchStatus report branch status
type ResourceManager ¶
type ResourceManager struct { Resource string `json:"r"` ProxySID string `json:"ps"` RMSID string `json:"cs"` LastHB time.Time `json:"-"` }
ResourceManager the resource manager
type ResourceManagerSet ¶
type ResourceManagerSet struct {
ResourceManagers []ResourceManager `json:"rms"`
}
ResourceManagerSet the resource manager set
type RetryNotLeaderMessage ¶
type RetryNotLeaderMessage struct { FID uint64 NewLeader uint64 NewLeaderStore uint64 RetryData []byte }
RetryNotLeaderMessage not leader
func AcquireRetryNotLeaderMessage ¶
func AcquireRetryNotLeaderMessage() *RetryNotLeaderMessage
AcquireRetryNotLeaderMessage acquire RetryNotLeaderMessage from pool
func (*RetryNotLeaderMessage) BatchEncode ¶
func (msg *RetryNotLeaderMessage) BatchEncode(buf *goetty.ByteBuf)
BatchEncode encode message
func (*RetryNotLeaderMessage) Decode ¶
func (msg *RetryNotLeaderMessage) Decode(buf *goetty.ByteBuf)
Decode decode message from byte buffer
func (*RetryNotLeaderMessage) Encode ¶
func (msg *RetryNotLeaderMessage) Encode() *goetty.ByteBuf
Encode encode message
func (*RetryNotLeaderMessage) Type ¶
func (msg *RetryNotLeaderMessage) Type() uint16
Type message type
type RouteableMessage ¶
type RouteableMessage struct { // ToStore direct send to this store ToStore uint64 // RMSID which session RMSID string // ProxyAddr proxy addr ProxyAddr string // Seq seq Seq uint64 // FID which fragment FID uint64 // Internal server internal Internal bool // Batch is in batch Batch bool // MsgID msgID MsgID uint64 // MsgType msg type MsgType uint16 // Data seata origin message Data []byte }
RouteableMessage wrap seata message for routing
func AcquireRouteableMessageForNotify ¶
func AcquireRouteableMessageForNotify(sid string, msgID uint64, origin Message) *RouteableMessage
AcquireRouteableMessageForNotify acquire a value from pool
func AcquireRouteableMessageForResponse ¶
func AcquireRouteableMessageForResponse(msg *RouteableMessage, origin Message) *RouteableMessage
AcquireRouteableMessageForResponse acquire a value from pool
func (*RouteableMessage) ReadOriginMsg ¶
func (rm *RouteableMessage) ReadOriginMsg() Message
ReadOriginMsg returns the origin msg
type StoreMeta ¶
type StoreMeta struct { ID uint64 `json:"id"` Addr string `json:"addr"` ClientAddr string `json:"cliAddr"` Labels []prophet.Pair `json:"lables"` }
StoreMeta is the container of Fragments
type Summary ¶
type Summary struct { ActiveBrchNum uint64 `json:"activeBrchNum"` ActiveTrxNum uint64 `json:"activeTrxNum"` SuccessBrchNum uint64 `json:"successBrchNum"` FailedBrchNum uint64 `json:"failedBrchNum"` SuccessTrxNum uint64 `json:"successTrxNum"` FailedTrxNum uint64 `json:"failedTrxNum"` }
Summary summary for all transactions