txn

package
v1.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 15, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// SkipResponseFlag skip response.
	SkipResponseFlag uint32 = 1
)

Variables

View Source
var (
	ErrInvalidLengthTxn        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowTxn          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupTxn = fmt.Errorf("proto: unexpected end of group")
)
View Source
var TxnIsolation_name = map[int32]string{
	0: "SI",
	1: "RC",
}
View Source
var TxnIsolation_value = map[string]int32{
	"SI": 0,
	"RC": 1,
}
View Source
var TxnMethod_name = map[int32]string{
	0: "Read",
	1: "Write",
	2: "Commit",
	3: "Rollback",
	4: "Prepare",
	5: "GetStatus",
	6: "CommitTNShard",
	7: "RollbackTNShard",
	8: "RemoveMedata",
	9: "DEBUG",
}
View Source
var TxnMethod_value = map[string]int32{
	"Read":            0,
	"Write":           1,
	"Commit":          2,
	"Rollback":        3,
	"Prepare":         4,
	"GetStatus":       5,
	"CommitTNShard":   6,
	"RollbackTNShard": 7,
	"RemoveMedata":    8,
	"DEBUG":           9,
}
View Source
var TxnMode_name = map[int32]string{
	0: "Optimistic",
	1: "Pessimistic",
}
View Source
var TxnMode_value = map[string]int32{
	"Optimistic":  0,
	"Pessimistic": 1,
}
View Source
var TxnStatus_name = map[int32]string{
	0: "Active",
	1: "Prepared",
	2: "Committing",
	3: "Committed",
	4: "Aborting",
	5: "Aborted",
}
View Source
var TxnStatus_value = map[string]int32{
	"Active":     0,
	"Prepared":   1,
	"Committing": 2,
	"Committed":  3,
	"Aborting":   4,
	"Aborted":    5,
}

Functions

func RequestsDebugString added in v0.6.0

func RequestsDebugString(requests []TxnRequest, withPayload bool) string

RequestsDebugString returns requests debug string

func ResponsesDebugString added in v0.6.0

func ResponsesDebugString(responses []TxnResponse) string

ResponsesDebugString returns responses debug string

func ValidTxnIsolation added in v0.8.0

func ValidTxnIsolation(value string) bool

ValidTxnIsolation valid txn isolation

func ValidTxnMode added in v0.8.0

func ValidTxnMode(value string) bool

ValidTxnMode valid txn mode

Types

type CNOpRequest

type CNOpRequest struct {
	// OpCode request operation type
	OpCode uint32 `protobuf:"varint,1,opt,name=OpCode,proto3" json:"OpCode,omitempty"`
	// Payload the content of the request, TxnClient does not perceive the exact
	// format and content
	Payload []byte `protobuf:"bytes,2,opt,name=Payload,proto3" json:"Payload,omitempty"`
	// Target target to which the request was sent
	Target               metadata.TNShard `protobuf:"bytes,3,opt,name=Target,proto3" json:"Target"`
	XXX_NoUnkeyedLiteral struct{}         `json:"-"`
	XXX_unrecognized     []byte           `json:"-"`
	XXX_sizecache        int32            `json:"-"`
}

CNOpRequest cn read/write request, CN -> TN. If data is written to more than one TN (>1) in a single transaction, then the transaction becomes a 2pc transaction.

func (CNOpRequest) DebugString

func (m CNOpRequest) DebugString() string

DebugString returns debug string

func (*CNOpRequest) Descriptor

func (*CNOpRequest) Descriptor() ([]byte, []int)

func (*CNOpRequest) GetOpCode

func (m *CNOpRequest) GetOpCode() uint32

func (*CNOpRequest) GetPayload

func (m *CNOpRequest) GetPayload() []byte

func (*CNOpRequest) GetTarget

func (m *CNOpRequest) GetTarget() metadata.TNShard

func (*CNOpRequest) Marshal

func (m *CNOpRequest) Marshal() (dAtA []byte, err error)

func (*CNOpRequest) MarshalTo

func (m *CNOpRequest) MarshalTo(dAtA []byte) (int, error)

func (*CNOpRequest) MarshalToSizedBuffer

func (m *CNOpRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*CNOpRequest) ProtoMessage

func (*CNOpRequest) ProtoMessage()

func (*CNOpRequest) Reset

func (m *CNOpRequest) Reset()

func (*CNOpRequest) Size

func (m *CNOpRequest) Size() (n int)

func (*CNOpRequest) String

func (m *CNOpRequest) String() string

func (*CNOpRequest) Unmarshal

func (m *CNOpRequest) Unmarshal(dAtA []byte) error

func (*CNOpRequest) XXX_DiscardUnknown

func (m *CNOpRequest) XXX_DiscardUnknown()

func (*CNOpRequest) XXX_Marshal

func (m *CNOpRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*CNOpRequest) XXX_Merge

func (m *CNOpRequest) XXX_Merge(src proto.Message)

func (*CNOpRequest) XXX_Size

func (m *CNOpRequest) XXX_Size() int

func (*CNOpRequest) XXX_Unmarshal

func (m *CNOpRequest) XXX_Unmarshal(b []byte) error

type CNOpResponse

type CNOpResponse struct {
	// Payload response payload
	Payload              []byte   `protobuf:"bytes,1,opt,name=Payload,proto3" json:"Payload,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

CNOpResponse cn read/write response, TN -> CN. A request corresponds to a response.

func GetCNOpResponse

func GetCNOpResponse(response TxnResponse) CNOpResponse

GetCNOpResponse returns the CNOpResponse from TxnResponse

func (CNOpResponse) DebugString

func (m CNOpResponse) DebugString() string

DebugString returns debug string

func (*CNOpResponse) Descriptor

func (*CNOpResponse) Descriptor() ([]byte, []int)

func (*CNOpResponse) GetPayload

func (m *CNOpResponse) GetPayload() []byte

func (*CNOpResponse) Marshal

func (m *CNOpResponse) Marshal() (dAtA []byte, err error)

func (*CNOpResponse) MarshalTo

func (m *CNOpResponse) MarshalTo(dAtA []byte) (int, error)

func (*CNOpResponse) MarshalToSizedBuffer

func (m *CNOpResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*CNOpResponse) ProtoMessage

func (*CNOpResponse) ProtoMessage()

func (*CNOpResponse) Reset

func (m *CNOpResponse) Reset()

func (*CNOpResponse) Size

func (m *CNOpResponse) Size() (n int)

func (*CNOpResponse) String

func (m *CNOpResponse) String() string

func (*CNOpResponse) Unmarshal

func (m *CNOpResponse) Unmarshal(dAtA []byte) error

func (*CNOpResponse) XXX_DiscardUnknown

func (m *CNOpResponse) XXX_DiscardUnknown()

func (*CNOpResponse) XXX_Marshal

func (m *CNOpResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*CNOpResponse) XXX_Merge

func (m *CNOpResponse) XXX_Merge(src proto.Message)

func (*CNOpResponse) XXX_Size

func (m *CNOpResponse) XXX_Size() int

func (*CNOpResponse) XXX_Unmarshal

func (m *CNOpResponse) XXX_Unmarshal(b []byte) error

type CNTxnSnapshot

type CNTxnSnapshot struct {
	// ID txn id
	Txn TxnMeta `protobuf:"bytes,1,opt,name=Txn,proto3" json:"Txn"`
	// ReadyOnly txn options
	ReadyOnly bool `protobuf:"varint,2,opt,name=ReadyOnly,proto3" json:"ReadyOnly,omitempty"`
	// EnableCacheWrite txn options
	EnableCacheWrite bool `protobuf:"varint,3,opt,name=EnableCacheWrite,proto3" json:"EnableCacheWrite,omitempty"`
	// Disable1PCOpt txn options
	Disable1PCOpt        bool             `protobuf:"varint,4,opt,name=Disable1PCOpt,proto3" json:"Disable1PCOpt,omitempty"`
	LockTables           []lock.LockTable `protobuf:"bytes,5,rep,name=LockTables,proto3" json:"LockTables"`
	XXX_NoUnkeyedLiteral struct{}         `json:"-"`
	XXX_unrecognized     []byte           `json:"-"`
	XXX_sizecache        int32            `json:"-"`
}

CNTxnSnapshot snapshot of the cn txn operation.

func (*CNTxnSnapshot) Descriptor

func (*CNTxnSnapshot) Descriptor() ([]byte, []int)

func (*CNTxnSnapshot) GetDisable1PCOpt

func (m *CNTxnSnapshot) GetDisable1PCOpt() bool

func (*CNTxnSnapshot) GetEnableCacheWrite

func (m *CNTxnSnapshot) GetEnableCacheWrite() bool

func (*CNTxnSnapshot) GetLockTables added in v0.8.0

func (m *CNTxnSnapshot) GetLockTables() []lock.LockTable

func (*CNTxnSnapshot) GetReadyOnly

func (m *CNTxnSnapshot) GetReadyOnly() bool

func (*CNTxnSnapshot) GetTxn

func (m *CNTxnSnapshot) GetTxn() TxnMeta

func (*CNTxnSnapshot) Marshal

func (m *CNTxnSnapshot) Marshal() (dAtA []byte, err error)

func (*CNTxnSnapshot) MarshalTo

func (m *CNTxnSnapshot) MarshalTo(dAtA []byte) (int, error)

func (*CNTxnSnapshot) MarshalToSizedBuffer

func (m *CNTxnSnapshot) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*CNTxnSnapshot) ProtoMessage

func (*CNTxnSnapshot) ProtoMessage()

func (*CNTxnSnapshot) Reset

func (m *CNTxnSnapshot) Reset()

func (*CNTxnSnapshot) Size

func (m *CNTxnSnapshot) Size() (n int)

func (*CNTxnSnapshot) String

func (m *CNTxnSnapshot) String() string

func (*CNTxnSnapshot) Unmarshal

func (m *CNTxnSnapshot) Unmarshal(dAtA []byte) error

func (*CNTxnSnapshot) XXX_DiscardUnknown

func (m *CNTxnSnapshot) XXX_DiscardUnknown()

func (*CNTxnSnapshot) XXX_Marshal

func (m *CNTxnSnapshot) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*CNTxnSnapshot) XXX_Merge

func (m *CNTxnSnapshot) XXX_Merge(src proto.Message)

func (*CNTxnSnapshot) XXX_Size

func (m *CNTxnSnapshot) XXX_Size() int

func (*CNTxnSnapshot) XXX_Unmarshal

func (m *CNTxnSnapshot) XXX_Unmarshal(b []byte) error

type TxnCommitRequest

type TxnCommitRequest struct {
	Payload              []*TxnRequest `protobuf:"bytes,1,rep,name=Payload,proto3" json:"Payload,omitempty"`
	Disable1PCOpt        bool          `protobuf:"varint,2,opt,name=Disable1PCOpt,proto3" json:"Disable1PCOpt,omitempty"`
	XXX_NoUnkeyedLiteral struct{}      `json:"-"`
	XXX_unrecognized     []byte        `json:"-"`
	XXX_sizecache        int32         `json:"-"`
}

TxnCommitRequest CN sent the commit request to coordinator TN.

func (*TxnCommitRequest) Descriptor

func (*TxnCommitRequest) Descriptor() ([]byte, []int)

func (*TxnCommitRequest) GetDisable1PCOpt

func (m *TxnCommitRequest) GetDisable1PCOpt() bool

func (*TxnCommitRequest) GetPayload added in v1.0.0

func (m *TxnCommitRequest) GetPayload() []*TxnRequest

func (*TxnCommitRequest) Marshal

func (m *TxnCommitRequest) Marshal() (dAtA []byte, err error)

func (*TxnCommitRequest) MarshalTo

func (m *TxnCommitRequest) MarshalTo(dAtA []byte) (int, error)

func (*TxnCommitRequest) MarshalToSizedBuffer

func (m *TxnCommitRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*TxnCommitRequest) ProtoMessage

func (*TxnCommitRequest) ProtoMessage()

func (*TxnCommitRequest) Reset

func (m *TxnCommitRequest) Reset()

func (*TxnCommitRequest) Size

func (m *TxnCommitRequest) Size() (n int)

func (*TxnCommitRequest) String

func (m *TxnCommitRequest) String() string

func (*TxnCommitRequest) Unmarshal

func (m *TxnCommitRequest) Unmarshal(dAtA []byte) error

func (*TxnCommitRequest) XXX_DiscardUnknown

func (m *TxnCommitRequest) XXX_DiscardUnknown()

func (*TxnCommitRequest) XXX_Marshal

func (m *TxnCommitRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*TxnCommitRequest) XXX_Merge

func (m *TxnCommitRequest) XXX_Merge(src proto.Message)

func (*TxnCommitRequest) XXX_Size

func (m *TxnCommitRequest) XXX_Size() int

func (*TxnCommitRequest) XXX_Unmarshal

func (m *TxnCommitRequest) XXX_Unmarshal(b []byte) error

type TxnCommitResponse

type TxnCommitResponse struct {
	InvalidLockTables    []uint64 `protobuf:"varint,1,rep,packed,name=InvalidLockTables,proto3" json:"InvalidLockTables,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

TxnCommitResponse response of TxnCommitRequest.

func (*TxnCommitResponse) Descriptor

func (*TxnCommitResponse) Descriptor() ([]byte, []int)

func (*TxnCommitResponse) GetInvalidLockTables added in v1.0.0

func (m *TxnCommitResponse) GetInvalidLockTables() []uint64

func (*TxnCommitResponse) Marshal

func (m *TxnCommitResponse) Marshal() (dAtA []byte, err error)

func (*TxnCommitResponse) MarshalTo

func (m *TxnCommitResponse) MarshalTo(dAtA []byte) (int, error)

func (*TxnCommitResponse) MarshalToSizedBuffer

func (m *TxnCommitResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*TxnCommitResponse) ProtoMessage

func (*TxnCommitResponse) ProtoMessage()

func (*TxnCommitResponse) Reset

func (m *TxnCommitResponse) Reset()

func (*TxnCommitResponse) Size

func (m *TxnCommitResponse) Size() (n int)

func (*TxnCommitResponse) String

func (m *TxnCommitResponse) String() string

func (*TxnCommitResponse) Unmarshal

func (m *TxnCommitResponse) Unmarshal(dAtA []byte) error

func (*TxnCommitResponse) XXX_DiscardUnknown

func (m *TxnCommitResponse) XXX_DiscardUnknown()

func (*TxnCommitResponse) XXX_Marshal

func (m *TxnCommitResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*TxnCommitResponse) XXX_Merge

func (m *TxnCommitResponse) XXX_Merge(src proto.Message)

func (*TxnCommitResponse) XXX_Size

func (m *TxnCommitResponse) XXX_Size() int

func (*TxnCommitResponse) XXX_Unmarshal

func (m *TxnCommitResponse) XXX_Unmarshal(b []byte) error

type TxnCommitTNShardRequest added in v1.0.0

type TxnCommitTNShardRequest struct {
	// TNShard target TN
	TNShard              metadata.TNShard `protobuf:"bytes,1,opt,name=TNShard,proto3" json:"TNShard"`
	XXX_NoUnkeyedLiteral struct{}         `json:"-"`
	XXX_unrecognized     []byte           `json:"-"`
	XXX_sizecache        int32            `json:"-"`
}

TxnCommitTNShardRequest commit txn on TNShard. Data needs to be written to the LogService.

func (*TxnCommitTNShardRequest) Descriptor added in v1.0.0

func (*TxnCommitTNShardRequest) Descriptor() ([]byte, []int)

func (*TxnCommitTNShardRequest) GetTNShard added in v1.0.0

func (m *TxnCommitTNShardRequest) GetTNShard() metadata.TNShard

func (*TxnCommitTNShardRequest) Marshal added in v1.0.0

func (m *TxnCommitTNShardRequest) Marshal() (dAtA []byte, err error)

func (*TxnCommitTNShardRequest) MarshalTo added in v1.0.0

func (m *TxnCommitTNShardRequest) MarshalTo(dAtA []byte) (int, error)

func (*TxnCommitTNShardRequest) MarshalToSizedBuffer added in v1.0.0

func (m *TxnCommitTNShardRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*TxnCommitTNShardRequest) ProtoMessage added in v1.0.0

func (*TxnCommitTNShardRequest) ProtoMessage()

func (*TxnCommitTNShardRequest) Reset added in v1.0.0

func (m *TxnCommitTNShardRequest) Reset()

func (*TxnCommitTNShardRequest) Size added in v1.0.0

func (m *TxnCommitTNShardRequest) Size() (n int)

func (*TxnCommitTNShardRequest) String added in v1.0.0

func (m *TxnCommitTNShardRequest) String() string

func (*TxnCommitTNShardRequest) Unmarshal added in v1.0.0

func (m *TxnCommitTNShardRequest) Unmarshal(dAtA []byte) error

func (*TxnCommitTNShardRequest) XXX_DiscardUnknown added in v1.0.0

func (m *TxnCommitTNShardRequest) XXX_DiscardUnknown()

func (*TxnCommitTNShardRequest) XXX_Marshal added in v1.0.0

func (m *TxnCommitTNShardRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*TxnCommitTNShardRequest) XXX_Merge added in v1.0.0

func (m *TxnCommitTNShardRequest) XXX_Merge(src proto.Message)

func (*TxnCommitTNShardRequest) XXX_Size added in v1.0.0

func (m *TxnCommitTNShardRequest) XXX_Size() int

func (*TxnCommitTNShardRequest) XXX_Unmarshal added in v1.0.0

func (m *TxnCommitTNShardRequest) XXX_Unmarshal(b []byte) error

type TxnCommitTNShardResponse added in v1.0.0

type TxnCommitTNShardResponse struct {
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

TxnCommitTNShardResponse response of TxnCommitTNShardRequest

func (*TxnCommitTNShardResponse) Descriptor added in v1.0.0

func (*TxnCommitTNShardResponse) Descriptor() ([]byte, []int)

func (*TxnCommitTNShardResponse) Marshal added in v1.0.0

func (m *TxnCommitTNShardResponse) Marshal() (dAtA []byte, err error)

func (*TxnCommitTNShardResponse) MarshalTo added in v1.0.0

func (m *TxnCommitTNShardResponse) MarshalTo(dAtA []byte) (int, error)

func (*TxnCommitTNShardResponse) MarshalToSizedBuffer added in v1.0.0

func (m *TxnCommitTNShardResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*TxnCommitTNShardResponse) ProtoMessage added in v1.0.0

func (*TxnCommitTNShardResponse) ProtoMessage()

func (*TxnCommitTNShardResponse) Reset added in v1.0.0

func (m *TxnCommitTNShardResponse) Reset()

func (*TxnCommitTNShardResponse) Size added in v1.0.0

func (m *TxnCommitTNShardResponse) Size() (n int)

func (*TxnCommitTNShardResponse) String added in v1.0.0

func (m *TxnCommitTNShardResponse) String() string

func (*TxnCommitTNShardResponse) Unmarshal added in v1.0.0

func (m *TxnCommitTNShardResponse) Unmarshal(dAtA []byte) error

func (*TxnCommitTNShardResponse) XXX_DiscardUnknown added in v1.0.0

func (m *TxnCommitTNShardResponse) XXX_DiscardUnknown()

func (*TxnCommitTNShardResponse) XXX_Marshal added in v1.0.0

func (m *TxnCommitTNShardResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*TxnCommitTNShardResponse) XXX_Merge added in v1.0.0

func (m *TxnCommitTNShardResponse) XXX_Merge(src proto.Message)

func (*TxnCommitTNShardResponse) XXX_Size added in v1.0.0

func (m *TxnCommitTNShardResponse) XXX_Size() int

func (*TxnCommitTNShardResponse) XXX_Unmarshal added in v1.0.0

func (m *TxnCommitTNShardResponse) XXX_Unmarshal(b []byte) error

type TxnError

type TxnError struct {
	// Code moerr code, used to special error handle without unmarshal moerr
	Code uint32 `protobuf:"varint,1,opt,name=Code,proto3" json:"Code,omitempty"`
	// Error we use this field to send moerr from tn to cn. Set with
	// moerr.MarshalBinary, and use moerr.UnmarshalBinary to restore
	// moerr.
	Error []byte `protobuf:"bytes,2,opt,name=Error,proto3" json:"Error,omitempty"`
	// TxnErrCode is a internal err code in the txn framework and used to indicate
	// what transaction operation failed. Usually this value is the same as the value
	// of Code, except for the error returned by the interface call to TxnStorage.
	// Because the types of errors returned by TxnStorage's interface are unknown to the
	// transaction framework, it is necessary to use a code for the interface call to uniformly
	// replace these error codes.
	TxnErrCode           uint32   `protobuf:"varint,3,opt,name=TxnErrCode,proto3" json:"TxnErrCode,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

TxnError all explicit errors in transaction operations.

func WrapError added in v0.6.0

func WrapError(err error, internalCode uint16) *TxnError

WrapError wrapper error to TxnError

func (TxnError) DebugString

func (m TxnError) DebugString() string

DebugString returns debug string

func (*TxnError) Descriptor

func (*TxnError) Descriptor() ([]byte, []int)

func (*TxnError) GetCode

func (m *TxnError) GetCode() uint32

func (*TxnError) GetError added in v0.6.0

func (m *TxnError) GetError() []byte

func (*TxnError) GetTxnErrCode added in v0.6.0

func (m *TxnError) GetTxnErrCode() uint32

func (*TxnError) Marshal

func (m *TxnError) Marshal() (dAtA []byte, err error)

func (*TxnError) MarshalTo

func (m *TxnError) MarshalTo(dAtA []byte) (int, error)

func (*TxnError) MarshalToSizedBuffer

func (m *TxnError) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*TxnError) ProtoMessage

func (*TxnError) ProtoMessage()

func (*TxnError) Reset

func (m *TxnError) Reset()

func (*TxnError) Size

func (m *TxnError) Size() (n int)

func (*TxnError) String

func (m *TxnError) String() string

func (*TxnError) Unmarshal

func (m *TxnError) Unmarshal(dAtA []byte) error

func (TxnError) UnwrapError added in v0.6.0

func (m TxnError) UnwrapError() error

UnwrapError unwrap the moerr from the TxnError

func (*TxnError) XXX_DiscardUnknown

func (m *TxnError) XXX_DiscardUnknown()

func (*TxnError) XXX_Marshal

func (m *TxnError) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*TxnError) XXX_Merge

func (m *TxnError) XXX_Merge(src proto.Message)

func (*TxnError) XXX_Size

func (m *TxnError) XXX_Size() int

func (*TxnError) XXX_Unmarshal

func (m *TxnError) XXX_Unmarshal(b []byte) error

type TxnGetStatusRequest

type TxnGetStatusRequest struct {
	// TNShard target TN
	TNShard              metadata.TNShard `protobuf:"bytes,1,opt,name=TNShard,proto3" json:"TNShard"`
	XXX_NoUnkeyedLiteral struct{}         `json:"-"`
	XXX_unrecognized     []byte           `json:"-"`
	XXX_sizecache        int32            `json:"-"`
}

TxnGetStatusRequest query the status of a transaction on TN

func (*TxnGetStatusRequest) Descriptor

func (*TxnGetStatusRequest) Descriptor() ([]byte, []int)

func (*TxnGetStatusRequest) GetTNShard added in v1.0.0

func (m *TxnGetStatusRequest) GetTNShard() metadata.TNShard

func (*TxnGetStatusRequest) Marshal

func (m *TxnGetStatusRequest) Marshal() (dAtA []byte, err error)

func (*TxnGetStatusRequest) MarshalTo

func (m *TxnGetStatusRequest) MarshalTo(dAtA []byte) (int, error)

func (*TxnGetStatusRequest) MarshalToSizedBuffer

func (m *TxnGetStatusRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*TxnGetStatusRequest) ProtoMessage

func (*TxnGetStatusRequest) ProtoMessage()

func (*TxnGetStatusRequest) Reset

func (m *TxnGetStatusRequest) Reset()

func (*TxnGetStatusRequest) Size

func (m *TxnGetStatusRequest) Size() (n int)

func (*TxnGetStatusRequest) String

func (m *TxnGetStatusRequest) String() string

func (*TxnGetStatusRequest) Unmarshal

func (m *TxnGetStatusRequest) Unmarshal(dAtA []byte) error

func (*TxnGetStatusRequest) XXX_DiscardUnknown

func (m *TxnGetStatusRequest) XXX_DiscardUnknown()

func (*TxnGetStatusRequest) XXX_Marshal

func (m *TxnGetStatusRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*TxnGetStatusRequest) XXX_Merge

func (m *TxnGetStatusRequest) XXX_Merge(src proto.Message)

func (*TxnGetStatusRequest) XXX_Size

func (m *TxnGetStatusRequest) XXX_Size() int

func (*TxnGetStatusRequest) XXX_Unmarshal

func (m *TxnGetStatusRequest) XXX_Unmarshal(b []byte) error

type TxnGetStatusResponse

type TxnGetStatusResponse struct {
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

TxnGetStatusResponse response of TxnGetStatusRequest

func (*TxnGetStatusResponse) Descriptor

func (*TxnGetStatusResponse) Descriptor() ([]byte, []int)

func (*TxnGetStatusResponse) Marshal

func (m *TxnGetStatusResponse) Marshal() (dAtA []byte, err error)

func (*TxnGetStatusResponse) MarshalTo

func (m *TxnGetStatusResponse) MarshalTo(dAtA []byte) (int, error)

func (*TxnGetStatusResponse) MarshalToSizedBuffer

func (m *TxnGetStatusResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*TxnGetStatusResponse) ProtoMessage

func (*TxnGetStatusResponse) ProtoMessage()

func (*TxnGetStatusResponse) Reset

func (m *TxnGetStatusResponse) Reset()

func (*TxnGetStatusResponse) Size

func (m *TxnGetStatusResponse) Size() (n int)

func (*TxnGetStatusResponse) String

func (m *TxnGetStatusResponse) String() string

func (*TxnGetStatusResponse) Unmarshal

func (m *TxnGetStatusResponse) Unmarshal(dAtA []byte) error

func (*TxnGetStatusResponse) XXX_DiscardUnknown

func (m *TxnGetStatusResponse) XXX_DiscardUnknown()

func (*TxnGetStatusResponse) XXX_Marshal

func (m *TxnGetStatusResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*TxnGetStatusResponse) XXX_Merge

func (m *TxnGetStatusResponse) XXX_Merge(src proto.Message)

func (*TxnGetStatusResponse) XXX_Size

func (m *TxnGetStatusResponse) XXX_Size() int

func (*TxnGetStatusResponse) XXX_Unmarshal

func (m *TxnGetStatusResponse) XXX_Unmarshal(b []byte) error

type TxnIsolation added in v0.8.0

type TxnIsolation int32

TxnIsolation txn txn isolation

const (
	// SI snapshot isolation
	TxnIsolation_SI TxnIsolation = 0
	// RC read committed
	TxnIsolation_RC TxnIsolation = 1
)

func GetTxnIsolation added in v0.8.0

func GetTxnIsolation(value string) TxnIsolation

GetTxnIsolation get txn mode from string

func (TxnIsolation) EnumDescriptor added in v0.8.0

func (TxnIsolation) EnumDescriptor() ([]byte, []int)

func (TxnIsolation) String added in v0.8.0

func (x TxnIsolation) String() string

type TxnMeta

type TxnMeta struct {
	// ID transaction id, generated at the CN node at the time of transaction creation,
	// globally unique.
	ID []byte `protobuf:"bytes,1,opt,name=ID,proto3" json:"ID,omitempty"`
	// Status transaction status
	Status TxnStatus `protobuf:"varint,2,opt,name=Status,proto3,enum=txn.TxnStatus" json:"Status,omitempty"`
	// SnapshotTS transaction read timestamp, generated at the CN node at the time of
	// transaction creation. All data.TS < txn.SnapshotTS is visible for the current
	// transaction.
	SnapshotTS timestamp.Timestamp `protobuf:"bytes,3,opt,name=SnapshotTS,proto3" json:"SnapshotTS"`
	// PreparedTS timestamp to complete the first phase of a 2pc commit transaction.
	PreparedTS timestamp.Timestamp `protobuf:"bytes,4,opt,name=PreparedTS,proto3" json:"PreparedTS"`
	// CommitTS transaction commit timestamp. For a 2pc transaction, commitTS = max(preparedTS).
	CommitTS timestamp.Timestamp `protobuf:"bytes,5,opt,name=CommitTS,proto3" json:"CommitTS"`
	// TNShards all TNShards that have written data. The first TN is the coordinator of the
	// transaction
	TNShards []metadata.TNShard `protobuf:"bytes,6,rep,name=TNShards,proto3" json:"TNShards"`
	// LockTables For pessimistic transactions, LockTables record the bind metadata of the
	// LockTable corresponding to the successful locking of the current transaction. This data
	// is committed to the TN at Commit time, and the TN will check once if these bindings have
	// changed, and if they have, the transaction will be rolled back.
	LockTables []lock.LockTable `protobuf:"bytes,7,rep,name=LockTables,proto3" json:"LockTables"`
	// TxnMode txn mode
	Mode TxnMode `protobuf:"varint,8,opt,name=Mode,proto3,enum=txn.TxnMode" json:"Mode,omitempty"`
	// TxnIsolation isolation
	Isolation TxnIsolation `protobuf:"varint,9,opt,name=Isolation,proto3,enum=txn.TxnIsolation" json:"Isolation,omitempty"`
	// Mirror is mirror is true, means the current txn is not created on current node.
	Mirror bool `protobuf:"varint,10,opt,name=Mirror,proto3" json:"Mirror,omitempty"`
	// LockService lock service's service address. Empty if is not pessimistic txn.
	LockService          string   `protobuf:"bytes,11,opt,name=LockService,proto3" json:"LockService,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

TxnMeta transaction metadata

func (TxnMeta) DebugString

func (m TxnMeta) DebugString() string

DebugString returns debug string

func (*TxnMeta) Descriptor

func (*TxnMeta) Descriptor() ([]byte, []int)

func (*TxnMeta) GetCommitTS

func (m *TxnMeta) GetCommitTS() timestamp.Timestamp

func (*TxnMeta) GetID

func (m *TxnMeta) GetID() []byte

func (*TxnMeta) GetIsolation added in v0.8.0

func (m *TxnMeta) GetIsolation() TxnIsolation

func (*TxnMeta) GetLockService added in v0.8.0

func (m *TxnMeta) GetLockService() string

func (*TxnMeta) GetLockTables added in v0.8.0

func (m *TxnMeta) GetLockTables() []lock.LockTable

func (*TxnMeta) GetMirror added in v0.8.0

func (m *TxnMeta) GetMirror() bool

func (*TxnMeta) GetMode added in v0.8.0

func (m *TxnMeta) GetMode() TxnMode

func (*TxnMeta) GetPreparedTS

func (m *TxnMeta) GetPreparedTS() timestamp.Timestamp

func (*TxnMeta) GetSnapshotTS

func (m *TxnMeta) GetSnapshotTS() timestamp.Timestamp

func (*TxnMeta) GetStatus

func (m *TxnMeta) GetStatus() TxnStatus

func (*TxnMeta) GetTNShards added in v1.0.0

func (m *TxnMeta) GetTNShards() []metadata.TNShard

func (TxnMeta) IsPessimistic added in v0.8.0

func (m TxnMeta) IsPessimistic() bool

IsPessimistic returns true if txn is in pessimistic mode

func (TxnMeta) IsRCIsolation added in v0.8.0

func (m TxnMeta) IsRCIsolation() bool

IsRCIsolation returns the isolation of current txn

func (*TxnMeta) Marshal

func (m *TxnMeta) Marshal() (dAtA []byte, err error)

func (*TxnMeta) MarshalTo

func (m *TxnMeta) MarshalTo(dAtA []byte) (int, error)

func (*TxnMeta) MarshalToSizedBuffer

func (m *TxnMeta) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*TxnMeta) ProtoMessage

func (*TxnMeta) ProtoMessage()

func (*TxnMeta) Reset

func (m *TxnMeta) Reset()

func (*TxnMeta) Size

func (m *TxnMeta) Size() (n int)

func (*TxnMeta) String

func (m *TxnMeta) String() string

func (*TxnMeta) Unmarshal

func (m *TxnMeta) Unmarshal(dAtA []byte) error

func (*TxnMeta) XXX_DiscardUnknown

func (m *TxnMeta) XXX_DiscardUnknown()

func (*TxnMeta) XXX_Marshal

func (m *TxnMeta) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*TxnMeta) XXX_Merge

func (m *TxnMeta) XXX_Merge(src proto.Message)

func (*TxnMeta) XXX_Size

func (m *TxnMeta) XXX_Size() int

func (*TxnMeta) XXX_Unmarshal

func (m *TxnMeta) XXX_Unmarshal(b []byte) error

type TxnMethod

type TxnMethod int32

TxnMethod transaction operations

const (
	// Read transaction read
	TxnMethod_Read TxnMethod = 0
	// Write transaction write
	TxnMethod_Write TxnMethod = 1
	// Commit commit transaction
	TxnMethod_Commit TxnMethod = 2
	// Rollback rollback transaction
	TxnMethod_Rollback TxnMethod = 3
	// Prepare when TN(Coordinator) receives a commit request from CN, it sends a prepare to
	// each TN(TNShard)
	TxnMethod_Prepare TxnMethod = 4
	// GetStatus query the status of a transaction on a TN. When a TN encounters a transaction
	// in the Prepared state, it needs to go to the TN(Coordinator) to query the status of the
	// current transaction. When a TN encounters a transaction in the Prepared state during the
	// recover, it needs to query the status of the transaction on each TN(TNShard) to determine
	// if the transaction is committed.
	TxnMethod_GetStatus TxnMethod = 5
	// CommitTNShard after the 2pc transaction is committed, the temporary data on each TN needs
	// to be explicitly converted to committed data.
	TxnMethod_CommitTNShard TxnMethod = 6
	// RollbackTNShard after the 2pc transaction is aborted, the temporary data on each TN needs
	// to cleanup.
	TxnMethod_RollbackTNShard TxnMethod = 7
	// RemoveMedata Remove metadata for transactions on TNShard. For a 2pc distributed transaction,
	// after all participating TNShards have Prepared successfully, the asynchronous commit process
	// starts, sending CommitTNShard requests to all participating TNShards in parallel. After each
	// TNShard has processed the CommitTNShard, the metadata of the transaction cannot be deleted
	// immediately, otherwise when the transaction coordinator node is down and restarted, the commit
	// status of the transaction cannot be determined in the recovery process, as it is possible that
	// some participating TNShards cannot find the transaction information.
	//
	// TODO: needs to work with TAE's log compaction, not currently supported.
	TxnMethod_RemoveMedata TxnMethod = 8
	// DEBUG used to send debug request from cn to tn, and received response from tn to cn
	TxnMethod_DEBUG TxnMethod = 9
)

func (TxnMethod) EnumDescriptor

func (TxnMethod) EnumDescriptor() ([]byte, []int)

func (TxnMethod) String

func (x TxnMethod) String() string

type TxnMode added in v0.8.0

type TxnMode int32

TxnMode txn mode

const (
	// Optimistic check conflict on commit.
	TxnMode_Optimistic TxnMode = 0
	// Pessimistic check conflict every write
	TxnMode_Pessimistic TxnMode = 1
)

func GetTxnMode added in v0.8.0

func GetTxnMode(value string) TxnMode

GetTxnMode get txn mode from string

func (TxnMode) EnumDescriptor added in v0.8.0

func (TxnMode) EnumDescriptor() ([]byte, []int)

func (TxnMode) String added in v0.8.0

func (x TxnMode) String() string

type TxnOptions added in v1.1.2

type TxnOptions struct {
	Counter              string   `protobuf:"bytes,1,opt,name=counter,proto3" json:"counter,omitempty"`
	SessionInfo          string   `protobuf:"bytes,2,opt,name=sessionInfo,proto3" json:"sessionInfo,omitempty"`
	InRunSql             bool     `protobuf:"varint,3,opt,name=inRunSql,proto3" json:"inRunSql,omitempty"`
	InCommit             bool     `protobuf:"varint,4,opt,name=inCommit,proto3" json:"inCommit,omitempty"`
	InRollback           bool     `protobuf:"varint,5,opt,name=inRollback,proto3" json:"inRollback,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*TxnOptions) Descriptor added in v1.1.2

func (*TxnOptions) Descriptor() ([]byte, []int)

func (*TxnOptions) GetCounter added in v1.1.2

func (m *TxnOptions) GetCounter() string

func (*TxnOptions) GetInCommit added in v1.1.2

func (m *TxnOptions) GetInCommit() bool

func (*TxnOptions) GetInRollback added in v1.1.2

func (m *TxnOptions) GetInRollback() bool

func (*TxnOptions) GetInRunSql added in v1.1.2

func (m *TxnOptions) GetInRunSql() bool

func (*TxnOptions) GetSessionInfo added in v1.1.2

func (m *TxnOptions) GetSessionInfo() string

func (*TxnOptions) Marshal added in v1.1.2

func (m *TxnOptions) Marshal() (dAtA []byte, err error)

func (*TxnOptions) MarshalTo added in v1.1.2

func (m *TxnOptions) MarshalTo(dAtA []byte) (int, error)

func (*TxnOptions) MarshalToSizedBuffer added in v1.1.2

func (m *TxnOptions) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*TxnOptions) ProtoMessage added in v1.1.2

func (*TxnOptions) ProtoMessage()

func (*TxnOptions) Reset added in v1.1.2

func (m *TxnOptions) Reset()

func (*TxnOptions) Size added in v1.1.2

func (m *TxnOptions) Size() (n int)

func (*TxnOptions) String added in v1.1.2

func (m *TxnOptions) String() string

func (*TxnOptions) Unmarshal added in v1.1.2

func (m *TxnOptions) Unmarshal(dAtA []byte) error

func (*TxnOptions) XXX_DiscardUnknown added in v1.1.2

func (m *TxnOptions) XXX_DiscardUnknown()

func (*TxnOptions) XXX_Marshal added in v1.1.2

func (m *TxnOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*TxnOptions) XXX_Merge added in v1.1.2

func (m *TxnOptions) XXX_Merge(src proto.Message)

func (*TxnOptions) XXX_Size added in v1.1.2

func (m *TxnOptions) XXX_Size() int

func (*TxnOptions) XXX_Unmarshal added in v1.1.2

func (m *TxnOptions) XXX_Unmarshal(b []byte) error

type TxnPrepareRequest

type TxnPrepareRequest struct {
	// TNShard prepare TN
	TNShard              metadata.TNShard `protobuf:"bytes,1,opt,name=TNShard,proto3" json:"TNShard"`
	XXX_NoUnkeyedLiteral struct{}         `json:"-"`
	XXX_unrecognized     []byte           `json:"-"`
	XXX_sizecache        int32            `json:"-"`
}

TxnPrepareRequest when a TN(coordinator) receives a Commit request from a CN, if more than one TN is involved, the 2PC commit process is enabled and the first phase is to send prepare requests to all TNs.

func (*TxnPrepareRequest) Descriptor

func (*TxnPrepareRequest) Descriptor() ([]byte, []int)

func (*TxnPrepareRequest) GetTNShard added in v1.0.0

func (m *TxnPrepareRequest) GetTNShard() metadata.TNShard

func (*TxnPrepareRequest) Marshal

func (m *TxnPrepareRequest) Marshal() (dAtA []byte, err error)

func (*TxnPrepareRequest) MarshalTo

func (m *TxnPrepareRequest) MarshalTo(dAtA []byte) (int, error)

func (*TxnPrepareRequest) MarshalToSizedBuffer

func (m *TxnPrepareRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*TxnPrepareRequest) ProtoMessage

func (*TxnPrepareRequest) ProtoMessage()

func (*TxnPrepareRequest) Reset

func (m *TxnPrepareRequest) Reset()

func (*TxnPrepareRequest) Size

func (m *TxnPrepareRequest) Size() (n int)

func (*TxnPrepareRequest) String

func (m *TxnPrepareRequest) String() string

func (*TxnPrepareRequest) Unmarshal

func (m *TxnPrepareRequest) Unmarshal(dAtA []byte) error

func (*TxnPrepareRequest) XXX_DiscardUnknown

func (m *TxnPrepareRequest) XXX_DiscardUnknown()

func (*TxnPrepareRequest) XXX_Marshal

func (m *TxnPrepareRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*TxnPrepareRequest) XXX_Merge

func (m *TxnPrepareRequest) XXX_Merge(src proto.Message)

func (*TxnPrepareRequest) XXX_Size

func (m *TxnPrepareRequest) XXX_Size() int

func (*TxnPrepareRequest) XXX_Unmarshal

func (m *TxnPrepareRequest) XXX_Unmarshal(b []byte) error

type TxnPrepareResponse

type TxnPrepareResponse struct {
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

TxnPrepareResponse response of TxnPrepareRequest

func (*TxnPrepareResponse) Descriptor

func (*TxnPrepareResponse) Descriptor() ([]byte, []int)

func (*TxnPrepareResponse) Marshal

func (m *TxnPrepareResponse) Marshal() (dAtA []byte, err error)

func (*TxnPrepareResponse) MarshalTo

func (m *TxnPrepareResponse) MarshalTo(dAtA []byte) (int, error)

func (*TxnPrepareResponse) MarshalToSizedBuffer

func (m *TxnPrepareResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*TxnPrepareResponse) ProtoMessage

func (*TxnPrepareResponse) ProtoMessage()

func (*TxnPrepareResponse) Reset

func (m *TxnPrepareResponse) Reset()

func (*TxnPrepareResponse) Size

func (m *TxnPrepareResponse) Size() (n int)

func (*TxnPrepareResponse) String

func (m *TxnPrepareResponse) String() string

func (*TxnPrepareResponse) Unmarshal

func (m *TxnPrepareResponse) Unmarshal(dAtA []byte) error

func (*TxnPrepareResponse) XXX_DiscardUnknown

func (m *TxnPrepareResponse) XXX_DiscardUnknown()

func (*TxnPrepareResponse) XXX_Marshal

func (m *TxnPrepareResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*TxnPrepareResponse) XXX_Merge

func (m *TxnPrepareResponse) XXX_Merge(src proto.Message)

func (*TxnPrepareResponse) XXX_Size

func (m *TxnPrepareResponse) XXX_Size() int

func (*TxnPrepareResponse) XXX_Unmarshal

func (m *TxnPrepareResponse) XXX_Unmarshal(b []byte) error

type TxnRemoveMetadataRequest

type TxnRemoveMetadataRequest struct {
	// TNShard target TN
	TNShard              metadata.TNShard `protobuf:"bytes,1,opt,name=TNShard,proto3" json:"TNShard"`
	XXX_NoUnkeyedLiteral struct{}         `json:"-"`
	XXX_unrecognized     []byte           `json:"-"`
	XXX_sizecache        int32            `json:"-"`
}

TxnRemoveMetadataRequest remove txn metadata on TNShard

func (*TxnRemoveMetadataRequest) Descriptor

func (*TxnRemoveMetadataRequest) Descriptor() ([]byte, []int)

func (*TxnRemoveMetadataRequest) GetTNShard added in v1.0.0

func (m *TxnRemoveMetadataRequest) GetTNShard() metadata.TNShard

func (*TxnRemoveMetadataRequest) Marshal

func (m *TxnRemoveMetadataRequest) Marshal() (dAtA []byte, err error)

func (*TxnRemoveMetadataRequest) MarshalTo

func (m *TxnRemoveMetadataRequest) MarshalTo(dAtA []byte) (int, error)

func (*TxnRemoveMetadataRequest) MarshalToSizedBuffer

func (m *TxnRemoveMetadataRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*TxnRemoveMetadataRequest) ProtoMessage

func (*TxnRemoveMetadataRequest) ProtoMessage()

func (*TxnRemoveMetadataRequest) Reset

func (m *TxnRemoveMetadataRequest) Reset()

func (*TxnRemoveMetadataRequest) Size

func (m *TxnRemoveMetadataRequest) Size() (n int)

func (*TxnRemoveMetadataRequest) String

func (m *TxnRemoveMetadataRequest) String() string

func (*TxnRemoveMetadataRequest) Unmarshal

func (m *TxnRemoveMetadataRequest) Unmarshal(dAtA []byte) error

func (*TxnRemoveMetadataRequest) XXX_DiscardUnknown

func (m *TxnRemoveMetadataRequest) XXX_DiscardUnknown()

func (*TxnRemoveMetadataRequest) XXX_Marshal

func (m *TxnRemoveMetadataRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*TxnRemoveMetadataRequest) XXX_Merge

func (m *TxnRemoveMetadataRequest) XXX_Merge(src proto.Message)

func (*TxnRemoveMetadataRequest) XXX_Size

func (m *TxnRemoveMetadataRequest) XXX_Size() int

func (*TxnRemoveMetadataRequest) XXX_Unmarshal

func (m *TxnRemoveMetadataRequest) XXX_Unmarshal(b []byte) error

type TxnRemoveMetadataResponse

type TxnRemoveMetadataResponse struct {
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

TxnRemoveMetadataResponse response of TxnRemoveMetadataRequest

func (*TxnRemoveMetadataResponse) Descriptor

func (*TxnRemoveMetadataResponse) Descriptor() ([]byte, []int)

func (*TxnRemoveMetadataResponse) Marshal

func (m *TxnRemoveMetadataResponse) Marshal() (dAtA []byte, err error)

func (*TxnRemoveMetadataResponse) MarshalTo

func (m *TxnRemoveMetadataResponse) MarshalTo(dAtA []byte) (int, error)

func (*TxnRemoveMetadataResponse) MarshalToSizedBuffer

func (m *TxnRemoveMetadataResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*TxnRemoveMetadataResponse) ProtoMessage

func (*TxnRemoveMetadataResponse) ProtoMessage()

func (*TxnRemoveMetadataResponse) Reset

func (m *TxnRemoveMetadataResponse) Reset()

func (*TxnRemoveMetadataResponse) Size

func (m *TxnRemoveMetadataResponse) Size() (n int)

func (*TxnRemoveMetadataResponse) String

func (m *TxnRemoveMetadataResponse) String() string

func (*TxnRemoveMetadataResponse) Unmarshal

func (m *TxnRemoveMetadataResponse) Unmarshal(dAtA []byte) error

func (*TxnRemoveMetadataResponse) XXX_DiscardUnknown

func (m *TxnRemoveMetadataResponse) XXX_DiscardUnknown()

func (*TxnRemoveMetadataResponse) XXX_Marshal

func (m *TxnRemoveMetadataResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*TxnRemoveMetadataResponse) XXX_Merge

func (m *TxnRemoveMetadataResponse) XXX_Merge(src proto.Message)

func (*TxnRemoveMetadataResponse) XXX_Size

func (m *TxnRemoveMetadataResponse) XXX_Size() int

func (*TxnRemoveMetadataResponse) XXX_Unmarshal

func (m *TxnRemoveMetadataResponse) XXX_Unmarshal(b []byte) error

type TxnRequest

type TxnRequest struct {
	// RequestID request id
	RequestID uint64 `protobuf:"varint,1,opt,name=RequestID,proto3" json:"RequestID,omitempty"`
	// Txn transaction metadata
	Txn TxnMeta `protobuf:"bytes,2,opt,name=Txn,proto3" json:"Txn"`
	// TxnMethod TxnRequest opCode, select the Request defined below according to TxnMethod.
	Method TxnMethod `protobuf:"varint,3,opt,name=Method,proto3,enum=txn.TxnMethod" json:"Method,omitempty"`
	// Flag request flag
	Flag uint32 `protobuf:"varint,4,opt,name=Flag,proto3" json:"Flag,omitempty"`
	// CNOpRequest corresponds to TxnMethod.Read, TxnMethod.Write
	CNRequest *CNOpRequest `protobuf:"bytes,5,opt,name=CNRequest,proto3" json:"CNRequest,omitempty"`
	// TxnCommitRequest corresponds to TxnMethod.Commit
	CommitRequest *TxnCommitRequest `protobuf:"bytes,6,opt,name=CommitRequest,proto3" json:"CommitRequest,omitempty"`
	// TxnRollbackRequest corresponds to TxnMethod.Rollback
	RollbackRequest *TxnRollbackRequest `protobuf:"bytes,7,opt,name=RollbackRequest,proto3" json:"RollbackRequest,omitempty"`
	// TxnPrepareRequest corresponds to TxnMethod.Prepare
	PrepareRequest *TxnPrepareRequest `protobuf:"bytes,8,opt,name=PrepareRequest,proto3" json:"PrepareRequest,omitempty"`
	// TxnGetStatusRequest corresponds to TxnMethod.GetStatus
	GetStatusRequest *TxnGetStatusRequest `protobuf:"bytes,9,opt,name=GetStatusRequest,proto3" json:"GetStatusRequest,omitempty"`
	// TxnCommitTNShardRequest corresponds to TxnMethod.CommitTNShard
	CommitTNShardRequest *TxnCommitTNShardRequest `protobuf:"bytes,10,opt,name=CommitTNShardRequest,proto3" json:"CommitTNShardRequest,omitempty"`
	// TxnRollbackTNShardRequest corresponds to TxnMethod.RollbackTNShard
	RollbackTNShardRequest *TxnRollbackTNShardRequest `protobuf:"bytes,11,opt,name=RollbackTNShardRequest,proto3" json:"RollbackTNShardRequest,omitempty"`
	// TxnRemoveMetadataRequest  corresponds to TxnMethod.RemoveMetadata
	RemoveMetadata *TxnRemoveMetadataRequest `protobuf:"bytes,12,opt,name=RemoveMetadata,proto3" json:"RemoveMetadata,omitempty"`
	// TxnRequestOptions request options
	Options              *TxnRequestOptions `protobuf:"bytes,13,opt,name=Options,proto3" json:"Options,omitempty"`
	XXX_NoUnkeyedLiteral struct{}           `json:"-"`
	XXX_unrecognized     []byte             `json:"-"`
	XXX_sizecache        int32              `json:"-"`
}

TxnRequest transaction request. All requests for the transaction are made using TxnRequest, so that the codec and logical processing of the RPC can be unified. Specific requests are selected according to TxnMethod.

Request flow of TxnRequest as below:

  1. CN -> TN (TxnMethod.Read, TxnMethod.Write, TxnMethod.Commit, TxnMethod.Rollback)
  2. TN -> TN (TxnMethod.Prepare, TxnMethod.GetStatus, TxnMethod.CommitTNShard, TxnMethod.RollbackTNShard, TxnMethod.RemoveMetadata)

func NewTxnRequest

func NewTxnRequest(request *CNOpRequest) TxnRequest

NewTxnRequest create TxnRequest by CNOpRequest

func (TxnRequest) DebugString

func (m TxnRequest) DebugString() string

DebugString returns debug string

func (TxnRequest) DebugStringWithPayload added in v0.7.0

func (m TxnRequest) DebugStringWithPayload(withPayload bool) string

DebugStringWithPayload returns debug string with payload bytes if withPayload is true

func (*TxnRequest) Descriptor

func (*TxnRequest) Descriptor() ([]byte, []int)

func (*TxnRequest) GetCNRequest

func (m *TxnRequest) GetCNRequest() *CNOpRequest

func (*TxnRequest) GetCommitRequest

func (m *TxnRequest) GetCommitRequest() *TxnCommitRequest

func (*TxnRequest) GetCommitTNShardRequest added in v1.0.0

func (m *TxnRequest) GetCommitTNShardRequest() *TxnCommitTNShardRequest

func (*TxnRequest) GetFlag

func (m *TxnRequest) GetFlag() uint32

func (*TxnRequest) GetGetStatusRequest

func (m *TxnRequest) GetGetStatusRequest() *TxnGetStatusRequest

func (*TxnRequest) GetID

func (m *TxnRequest) GetID() uint64

GetID implement morpc Messgae

func (*TxnRequest) GetMethod

func (m *TxnRequest) GetMethod() TxnMethod

func (*TxnRequest) GetOptions added in v0.6.0

func (m *TxnRequest) GetOptions() *TxnRequestOptions

func (*TxnRequest) GetPrepareRequest

func (m *TxnRequest) GetPrepareRequest() *TxnPrepareRequest

func (*TxnRequest) GetRemoveMetadata

func (m *TxnRequest) GetRemoveMetadata() *TxnRemoveMetadataRequest

func (*TxnRequest) GetRequestID

func (m *TxnRequest) GetRequestID() uint64

func (*TxnRequest) GetRollbackRequest

func (m *TxnRequest) GetRollbackRequest() *TxnRollbackRequest

func (*TxnRequest) GetRollbackTNShardRequest added in v1.0.0

func (m *TxnRequest) GetRollbackTNShardRequest() *TxnRollbackTNShardRequest

func (TxnRequest) GetTargetTN added in v1.0.0

func (m TxnRequest) GetTargetTN() metadata.TNShard

GetTargetTN return tn shard ID that message need send to.

func (*TxnRequest) GetTxn

func (m *TxnRequest) GetTxn() TxnMeta

func (*TxnRequest) Marshal

func (m *TxnRequest) Marshal() (dAtA []byte, err error)

func (*TxnRequest) MarshalTo

func (m *TxnRequest) MarshalTo(dAtA []byte) (int, error)

func (*TxnRequest) MarshalToSizedBuffer

func (m *TxnRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*TxnRequest) ProtoMessage

func (*TxnRequest) ProtoMessage()

func (*TxnRequest) Reset

func (m *TxnRequest) Reset()

func (*TxnRequest) SetID

func (m *TxnRequest) SetID(id uint64)

SetID implement morpc Messgae

func (*TxnRequest) Size

func (m *TxnRequest) Size() (n int)

func (*TxnRequest) String

func (m *TxnRequest) String() string

func (*TxnRequest) Unmarshal

func (m *TxnRequest) Unmarshal(dAtA []byte) error

func (*TxnRequest) XXX_DiscardUnknown

func (m *TxnRequest) XXX_DiscardUnknown()

func (*TxnRequest) XXX_Marshal

func (m *TxnRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*TxnRequest) XXX_Merge

func (m *TxnRequest) XXX_Merge(src proto.Message)

func (*TxnRequest) XXX_Size

func (m *TxnRequest) XXX_Size() int

func (*TxnRequest) XXX_Unmarshal

func (m *TxnRequest) XXX_Unmarshal(b []byte) error

type TxnRequestOptions added in v0.6.0

type TxnRequestOptions struct {
	// RetryCodes when TN processes TxnRequest and encounters the specified error, it needs to retry
	// on the server side. Only read and write can retry.
	RetryCodes []int32 `protobuf:"varint,1,rep,packed,name=RetryCodes,proto3" json:"RetryCodes,omitempty"`
	// RetryInterval retry interval, default is 100ms.
	RetryInterval        int64    `protobuf:"varint,2,opt,name=RetryInterval,proto3" json:"RetryInterval,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

TxnRequestOptions txn options

func (*TxnRequestOptions) Descriptor added in v0.6.0

func (*TxnRequestOptions) Descriptor() ([]byte, []int)

func (*TxnRequestOptions) GetRetryCodes added in v0.6.0

func (m *TxnRequestOptions) GetRetryCodes() []int32

func (*TxnRequestOptions) GetRetryInterval added in v0.6.0

func (m *TxnRequestOptions) GetRetryInterval() int64

func (*TxnRequestOptions) Marshal added in v0.6.0

func (m *TxnRequestOptions) Marshal() (dAtA []byte, err error)

func (*TxnRequestOptions) MarshalTo added in v0.6.0

func (m *TxnRequestOptions) MarshalTo(dAtA []byte) (int, error)

func (*TxnRequestOptions) MarshalToSizedBuffer added in v0.6.0

func (m *TxnRequestOptions) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*TxnRequestOptions) ProtoMessage added in v0.6.0

func (*TxnRequestOptions) ProtoMessage()

func (*TxnRequestOptions) Reset added in v0.6.0

func (m *TxnRequestOptions) Reset()

func (*TxnRequestOptions) Size added in v0.6.0

func (m *TxnRequestOptions) Size() (n int)

func (*TxnRequestOptions) String added in v0.6.0

func (m *TxnRequestOptions) String() string

func (*TxnRequestOptions) Unmarshal added in v0.6.0

func (m *TxnRequestOptions) Unmarshal(dAtA []byte) error

func (*TxnRequestOptions) XXX_DiscardUnknown added in v0.6.0

func (m *TxnRequestOptions) XXX_DiscardUnknown()

func (*TxnRequestOptions) XXX_Marshal added in v0.6.0

func (m *TxnRequestOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*TxnRequestOptions) XXX_Merge added in v0.6.0

func (m *TxnRequestOptions) XXX_Merge(src proto.Message)

func (*TxnRequestOptions) XXX_Size added in v0.6.0

func (m *TxnRequestOptions) XXX_Size() int

func (*TxnRequestOptions) XXX_Unmarshal added in v0.6.0

func (m *TxnRequestOptions) XXX_Unmarshal(b []byte) error

type TxnResponse

type TxnResponse struct {
	// RequestID corresponding request id
	RequestID uint64 `protobuf:"varint,1,opt,name=RequestID,proto3" json:"RequestID,omitempty"`
	// Txn transaction metadata. TxnResponse.TxnMeta and TxnRequest.TxnMeta may differ
	// in that the node initiating the TxnRequest needs to process the returned TxnMeta,
	// e.g. to determine whether the transaction is Aborted by the status of the returned
	// TxnMeta.
	Txn *TxnMeta `protobuf:"bytes,2,opt,name=Txn,proto3" json:"Txn,omitempty"`
	// TxnMethod same as TxnRequest.TxnMethod
	Method TxnMethod `protobuf:"varint,3,opt,name=Method,proto3,enum=txn.TxnMethod" json:"Method,omitempty"`
	// Flag request flag, same as the corresponding request
	Flag uint32 `protobuf:"varint,4,opt,name=Flag,proto3" json:"Flag,omitempty"`
	// TxnError explicit error
	TxnError *TxnError `protobuf:"bytes,5,opt,name=TxnError,proto3" json:"TxnError,omitempty"`
	// CNOpResponse corresponds to TxnMethod.Read, TxnMethod.Write response
	CNOpResponse *CNOpResponse `protobuf:"bytes,6,opt,name=CNOpResponse,proto3" json:"CNOpResponse,omitempty"`
	// TxnCommitResponse corresponds to TxnMethod.Commit response
	CommitResponse *TxnCommitResponse `protobuf:"bytes,7,opt,name=CommitResponse,proto3" json:"CommitResponse,omitempty"`
	// TxnRollbackResponse corresponds to TxnMethod.Rollback response
	RollbackResponse *TxnRollbackResponse `protobuf:"bytes,8,opt,name=RollbackResponse,proto3" json:"RollbackResponse,omitempty"`
	// TxnPrepareResponse corresponds to TxnMethod.Prepare response
	PrepareResponse *TxnPrepareResponse `protobuf:"bytes,9,opt,name=PrepareResponse,proto3" json:"PrepareResponse,omitempty"`
	// TxnGetStatusResponse corresponds to TxnMethod.GetStatus response
	GetStatusResponse *TxnGetStatusResponse `protobuf:"bytes,10,opt,name=GetStatusResponse,proto3" json:"GetStatusResponse,omitempty"`
	// TxnCommitTNShardResponse corresponds to TxnMethod.CommitTNShard response
	CommitTNShardResponse *TxnCommitTNShardResponse `protobuf:"bytes,11,opt,name=CommitTNShardResponse,proto3" json:"CommitTNShardResponse,omitempty"`
	// TxnRollbackTNShardResponse corresponds to TxnMethod.RollbackTNShard response
	RollbackTNShardResponse *TxnRollbackTNShardResponse `protobuf:"bytes,12,opt,name=RollbackTNShardResponse,proto3" json:"RollbackTNShardResponse,omitempty"`
	// TxnRemoveMetadataResponse  corresponds to TxnMethod.RemoveMetadata
	RemoveMetadata       *TxnRemoveMetadataResponse `protobuf:"bytes,13,opt,name=RemoveMetadata,proto3" json:"RemoveMetadata,omitempty"`
	XXX_NoUnkeyedLiteral struct{}                   `json:"-"`
	XXX_unrecognized     []byte                     `json:"-"`
	XXX_sizecache        int32                      `json:"-"`
}

TxnResponse response of TxnRequest.

func (TxnResponse) DebugString

func (m TxnResponse) DebugString() string

DebugString returns debug string

func (*TxnResponse) Descriptor

func (*TxnResponse) Descriptor() ([]byte, []int)

func (*TxnResponse) GetCNOpResponse

func (m *TxnResponse) GetCNOpResponse() *CNOpResponse

func (*TxnResponse) GetCommitResponse

func (m *TxnResponse) GetCommitResponse() *TxnCommitResponse

func (*TxnResponse) GetCommitTNShardResponse added in v1.0.0

func (m *TxnResponse) GetCommitTNShardResponse() *TxnCommitTNShardResponse

func (*TxnResponse) GetFlag

func (m *TxnResponse) GetFlag() uint32

func (*TxnResponse) GetGetStatusResponse

func (m *TxnResponse) GetGetStatusResponse() *TxnGetStatusResponse

func (*TxnResponse) GetID

func (m *TxnResponse) GetID() uint64

GetID implement morpc Messgae

func (*TxnResponse) GetMethod

func (m *TxnResponse) GetMethod() TxnMethod

func (*TxnResponse) GetPrepareResponse

func (m *TxnResponse) GetPrepareResponse() *TxnPrepareResponse

func (*TxnResponse) GetRemoveMetadata

func (m *TxnResponse) GetRemoveMetadata() *TxnRemoveMetadataResponse

func (*TxnResponse) GetRequestID

func (m *TxnResponse) GetRequestID() uint64

func (*TxnResponse) GetRollbackResponse

func (m *TxnResponse) GetRollbackResponse() *TxnRollbackResponse

func (*TxnResponse) GetRollbackTNShardResponse added in v1.0.0

func (m *TxnResponse) GetRollbackTNShardResponse() *TxnRollbackTNShardResponse

func (*TxnResponse) GetTxn

func (m *TxnResponse) GetTxn() *TxnMeta

func (*TxnResponse) GetTxnError

func (m *TxnResponse) GetTxnError() *TxnError

func (TxnResponse) HasFlag

func (m TxnResponse) HasFlag(flag uint32) bool

HasFlag returns true if has the spec flag

func (*TxnResponse) Marshal

func (m *TxnResponse) Marshal() (dAtA []byte, err error)

func (*TxnResponse) MarshalTo

func (m *TxnResponse) MarshalTo(dAtA []byte) (int, error)

func (*TxnResponse) MarshalToSizedBuffer

func (m *TxnResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*TxnResponse) ProtoMessage

func (*TxnResponse) ProtoMessage()

func (*TxnResponse) Reset

func (m *TxnResponse) Reset()

func (*TxnResponse) SetID

func (m *TxnResponse) SetID(id uint64)

SetID implement morpc Messgae

func (*TxnResponse) Size

func (m *TxnResponse) Size() (n int)

func (*TxnResponse) String

func (m *TxnResponse) String() string

func (*TxnResponse) Unmarshal

func (m *TxnResponse) Unmarshal(dAtA []byte) error

func (*TxnResponse) XXX_DiscardUnknown

func (m *TxnResponse) XXX_DiscardUnknown()

func (*TxnResponse) XXX_Marshal

func (m *TxnResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*TxnResponse) XXX_Merge

func (m *TxnResponse) XXX_Merge(src proto.Message)

func (*TxnResponse) XXX_Size

func (m *TxnResponse) XXX_Size() int

func (*TxnResponse) XXX_Unmarshal

func (m *TxnResponse) XXX_Unmarshal(b []byte) error

type TxnRollbackRequest

type TxnRollbackRequest struct {
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

TxnCommitRequest CN sent the rollback request to coordinator TN.

func (*TxnRollbackRequest) Descriptor

func (*TxnRollbackRequest) Descriptor() ([]byte, []int)

func (*TxnRollbackRequest) Marshal

func (m *TxnRollbackRequest) Marshal() (dAtA []byte, err error)

func (*TxnRollbackRequest) MarshalTo

func (m *TxnRollbackRequest) MarshalTo(dAtA []byte) (int, error)

func (*TxnRollbackRequest) MarshalToSizedBuffer

func (m *TxnRollbackRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*TxnRollbackRequest) ProtoMessage

func (*TxnRollbackRequest) ProtoMessage()

func (*TxnRollbackRequest) Reset

func (m *TxnRollbackRequest) Reset()

func (*TxnRollbackRequest) Size

func (m *TxnRollbackRequest) Size() (n int)

func (*TxnRollbackRequest) String

func (m *TxnRollbackRequest) String() string

func (*TxnRollbackRequest) Unmarshal

func (m *TxnRollbackRequest) Unmarshal(dAtA []byte) error

func (*TxnRollbackRequest) XXX_DiscardUnknown

func (m *TxnRollbackRequest) XXX_DiscardUnknown()

func (*TxnRollbackRequest) XXX_Marshal

func (m *TxnRollbackRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*TxnRollbackRequest) XXX_Merge

func (m *TxnRollbackRequest) XXX_Merge(src proto.Message)

func (*TxnRollbackRequest) XXX_Size

func (m *TxnRollbackRequest) XXX_Size() int

func (*TxnRollbackRequest) XXX_Unmarshal

func (m *TxnRollbackRequest) XXX_Unmarshal(b []byte) error

type TxnRollbackResponse

type TxnRollbackResponse struct {
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

TxnRollbackResponse response of TxnRollbackRequest.

func (*TxnRollbackResponse) Descriptor

func (*TxnRollbackResponse) Descriptor() ([]byte, []int)

func (*TxnRollbackResponse) Marshal

func (m *TxnRollbackResponse) Marshal() (dAtA []byte, err error)

func (*TxnRollbackResponse) MarshalTo

func (m *TxnRollbackResponse) MarshalTo(dAtA []byte) (int, error)

func (*TxnRollbackResponse) MarshalToSizedBuffer

func (m *TxnRollbackResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*TxnRollbackResponse) ProtoMessage

func (*TxnRollbackResponse) ProtoMessage()

func (*TxnRollbackResponse) Reset

func (m *TxnRollbackResponse) Reset()

func (*TxnRollbackResponse) Size

func (m *TxnRollbackResponse) Size() (n int)

func (*TxnRollbackResponse) String

func (m *TxnRollbackResponse) String() string

func (*TxnRollbackResponse) Unmarshal

func (m *TxnRollbackResponse) Unmarshal(dAtA []byte) error

func (*TxnRollbackResponse) XXX_DiscardUnknown

func (m *TxnRollbackResponse) XXX_DiscardUnknown()

func (*TxnRollbackResponse) XXX_Marshal

func (m *TxnRollbackResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*TxnRollbackResponse) XXX_Merge

func (m *TxnRollbackResponse) XXX_Merge(src proto.Message)

func (*TxnRollbackResponse) XXX_Size

func (m *TxnRollbackResponse) XXX_Size() int

func (*TxnRollbackResponse) XXX_Unmarshal

func (m *TxnRollbackResponse) XXX_Unmarshal(b []byte) error

type TxnRollbackTNShardRequest added in v1.0.0

type TxnRollbackTNShardRequest struct {
	// TNShard target TN
	TNShard              metadata.TNShard `protobuf:"bytes,1,opt,name=TNShard,proto3" json:"TNShard"`
	XXX_NoUnkeyedLiteral struct{}         `json:"-"`
	XXX_unrecognized     []byte           `json:"-"`
	XXX_sizecache        int32            `json:"-"`
}

TxnRollbackTNShardRequest rollback txn on TNShard

func (*TxnRollbackTNShardRequest) Descriptor added in v1.0.0

func (*TxnRollbackTNShardRequest) Descriptor() ([]byte, []int)

func (*TxnRollbackTNShardRequest) GetTNShard added in v1.0.0

func (m *TxnRollbackTNShardRequest) GetTNShard() metadata.TNShard

func (*TxnRollbackTNShardRequest) Marshal added in v1.0.0

func (m *TxnRollbackTNShardRequest) Marshal() (dAtA []byte, err error)

func (*TxnRollbackTNShardRequest) MarshalTo added in v1.0.0

func (m *TxnRollbackTNShardRequest) MarshalTo(dAtA []byte) (int, error)

func (*TxnRollbackTNShardRequest) MarshalToSizedBuffer added in v1.0.0

func (m *TxnRollbackTNShardRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*TxnRollbackTNShardRequest) ProtoMessage added in v1.0.0

func (*TxnRollbackTNShardRequest) ProtoMessage()

func (*TxnRollbackTNShardRequest) Reset added in v1.0.0

func (m *TxnRollbackTNShardRequest) Reset()

func (*TxnRollbackTNShardRequest) Size added in v1.0.0

func (m *TxnRollbackTNShardRequest) Size() (n int)

func (*TxnRollbackTNShardRequest) String added in v1.0.0

func (m *TxnRollbackTNShardRequest) String() string

func (*TxnRollbackTNShardRequest) Unmarshal added in v1.0.0

func (m *TxnRollbackTNShardRequest) Unmarshal(dAtA []byte) error

func (*TxnRollbackTNShardRequest) XXX_DiscardUnknown added in v1.0.0

func (m *TxnRollbackTNShardRequest) XXX_DiscardUnknown()

func (*TxnRollbackTNShardRequest) XXX_Marshal added in v1.0.0

func (m *TxnRollbackTNShardRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*TxnRollbackTNShardRequest) XXX_Merge added in v1.0.0

func (m *TxnRollbackTNShardRequest) XXX_Merge(src proto.Message)

func (*TxnRollbackTNShardRequest) XXX_Size added in v1.0.0

func (m *TxnRollbackTNShardRequest) XXX_Size() int

func (*TxnRollbackTNShardRequest) XXX_Unmarshal added in v1.0.0

func (m *TxnRollbackTNShardRequest) XXX_Unmarshal(b []byte) error

type TxnRollbackTNShardResponse added in v1.0.0

type TxnRollbackTNShardResponse struct {
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

TxnRollbackTNShardResponse response of TxnRollbackTNShardRequest

func (*TxnRollbackTNShardResponse) Descriptor added in v1.0.0

func (*TxnRollbackTNShardResponse) Descriptor() ([]byte, []int)

func (*TxnRollbackTNShardResponse) Marshal added in v1.0.0

func (m *TxnRollbackTNShardResponse) Marshal() (dAtA []byte, err error)

func (*TxnRollbackTNShardResponse) MarshalTo added in v1.0.0

func (m *TxnRollbackTNShardResponse) MarshalTo(dAtA []byte) (int, error)

func (*TxnRollbackTNShardResponse) MarshalToSizedBuffer added in v1.0.0

func (m *TxnRollbackTNShardResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*TxnRollbackTNShardResponse) ProtoMessage added in v1.0.0

func (*TxnRollbackTNShardResponse) ProtoMessage()

func (*TxnRollbackTNShardResponse) Reset added in v1.0.0

func (m *TxnRollbackTNShardResponse) Reset()

func (*TxnRollbackTNShardResponse) Size added in v1.0.0

func (m *TxnRollbackTNShardResponse) Size() (n int)

func (*TxnRollbackTNShardResponse) String added in v1.0.0

func (m *TxnRollbackTNShardResponse) String() string

func (*TxnRollbackTNShardResponse) Unmarshal added in v1.0.0

func (m *TxnRollbackTNShardResponse) Unmarshal(dAtA []byte) error

func (*TxnRollbackTNShardResponse) XXX_DiscardUnknown added in v1.0.0

func (m *TxnRollbackTNShardResponse) XXX_DiscardUnknown()

func (*TxnRollbackTNShardResponse) XXX_Marshal added in v1.0.0

func (m *TxnRollbackTNShardResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*TxnRollbackTNShardResponse) XXX_Merge added in v1.0.0

func (m *TxnRollbackTNShardResponse) XXX_Merge(src proto.Message)

func (*TxnRollbackTNShardResponse) XXX_Size added in v1.0.0

func (m *TxnRollbackTNShardResponse) XXX_Size() int

func (*TxnRollbackTNShardResponse) XXX_Unmarshal added in v1.0.0

func (m *TxnRollbackTNShardResponse) XXX_Unmarshal(b []byte) error

type TxnStatus

type TxnStatus int32

TxnStatus transaction status

const (
	// Active is the state of transaction creation, in this state, can execute the
	// transaction Read/Write/Commit/Rollback.
	TxnStatus_Active TxnStatus = 0
	// Prepared for distributed transactions across TNs, a 2pc commit is performed,
	// and the prepared status means that the transaction on a TN was executed
	// successfully in the first phase.
	//
	// Note that this status needs to be saved to the LogService. Once the first
	// phase of a transaction is successful, data cannot be lost.
	TxnStatus_Prepared TxnStatus = 1
	// Committing for distributed transactions across TNs, once all TNs have completed
	// the first phase, the transaction enters the Committing state and initiates an
	// asynchronous process to handle the commit of temporary data.
	//
	// Note that when all TNs involved are in the prepared state, the distributed
	// transaction can be considered committed because all data has been written
	// successfully. The subsequent Committing process just explicitly converts these
	// writes into committed data.
	//
	// Note that the state exists only in memory and is not persisted to the LogService.
	// It can be restored through the Prepared state, if all(TN).Status == Prepared.
	TxnStatus_Committing TxnStatus = 2
	// Committed after the Committing phase has transformed all TN data involved into
	// committed data, the status of the distributed transaction is explicitly recorded
	// as Committed.
	//
	// Note that this status needs to be saved to the LogService
	TxnStatus_Committed TxnStatus = 3
	// Aborting a client initiating a Rollback call or a distributed transaction that has
	// any error in the first phase will enter the Aborting state. This state starts an
	// asynchronous task to clean up the temporary data written by the transaction.
	//
	// Note that the state exists only in memory and is not persisted to the LogService.
	// It can be restored through the Prepared state, if Any(TN).Status != Prepared.
	TxnStatus_Aborting TxnStatus = 4
	// Aborted after the Aborting phase, all data involved in the TN is cleaned up and
	// the transaction status is explicitly recorded as Aborted.
	//
	// Note that this status needs to be saved to the LogService
	TxnStatus_Aborted TxnStatus = 5
)

func (TxnStatus) EnumDescriptor

func (TxnStatus) EnumDescriptor() ([]byte, []int)

func (TxnStatus) String

func (x TxnStatus) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL