tablepb

package
v0.0.0-...-3f1ab7e Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2024 License: Apache-2.0 Imports: 13 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthTable        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowTable          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupTable = fmt.Errorf("proto: unexpected end of group")
)
View Source
var TableState_name = map[int32]string{
	0: "Unknown",
	1: "Absent",
	2: "Preparing",
	3: "Prepared",
	4: "Replicating",
	5: "Stopping",
	6: "Stopped",
}
View Source
var TableState_value = map[string]int32{
	"Unknown":     0,
	"Absent":      1,
	"Preparing":   2,
	"Prepared":    3,
	"Replicating": 4,
	"Stopping":    5,
	"Stopped":     6,
}

Functions

This section is empty.

Types

type Checkpoint

type Checkpoint struct {
	CheckpointTs Ts `protobuf:"varint,1,opt,name=checkpoint_ts,json=checkpointTs,proto3,casttype=Ts" json:"checkpoint_ts,omitempty"`
	ResolvedTs   Ts `protobuf:"varint,2,opt,name=resolved_ts,json=resolvedTs,proto3,casttype=Ts" json:"resolved_ts,omitempty"`
	LastSyncedTs Ts `protobuf:"varint,3,opt,name=last_synced_ts,json=lastSyncedTs,proto3,casttype=Ts" json:"last_synced_ts,omitempty"`
}

func (*Checkpoint) Descriptor

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

func (*Checkpoint) GetCheckpointTs

func (m *Checkpoint) GetCheckpointTs() Ts

func (*Checkpoint) GetLastSyncedTs

func (m *Checkpoint) GetLastSyncedTs() Ts

func (*Checkpoint) GetResolvedTs

func (m *Checkpoint) GetResolvedTs() Ts

func (*Checkpoint) Marshal

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

func (*Checkpoint) MarshalTo

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

func (*Checkpoint) MarshalToSizedBuffer

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

func (*Checkpoint) ProtoMessage

func (*Checkpoint) ProtoMessage()

func (*Checkpoint) Reset

func (m *Checkpoint) Reset()

func (*Checkpoint) Size

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

func (*Checkpoint) String

func (m *Checkpoint) String() string

func (*Checkpoint) Unmarshal

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

func (*Checkpoint) XXX_DiscardUnknown

func (m *Checkpoint) XXX_DiscardUnknown()

func (*Checkpoint) XXX_Marshal

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

func (*Checkpoint) XXX_Merge

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

func (*Checkpoint) XXX_Size

func (m *Checkpoint) XXX_Size() int

func (*Checkpoint) XXX_Unmarshal

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

type Key

type Key []byte

Key is a custom type for bytes encoded in memcomparable format. Key is read-only, must not be mutated.

func (Key) MarshalJSON

func (k Key) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler. It is helpful to format span in log.

func (Key) String

func (k Key) String() string

type Span

type Span struct {
	TableID  TableID `protobuf:"varint,1,opt,name=table_id,json=tableId,proto3,casttype=TableID" json:"table_id,omitempty"`
	StartKey Key     `protobuf:"bytes,2,opt,name=start_key,json=startKey,proto3,casttype=Key" json:"start_key,omitempty"`
	EndKey   Key     `protobuf:"bytes,3,opt,name=end_key,json=endKey,proto3,casttype=Key" json:"end_key,omitempty"`
}

Span is a full extent of key space from an inclusive start_key to an exclusive end_key.

func (*Span) Descriptor

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

func (*Span) Eq

func (s *Span) Eq(b *Span) bool

Eq compares two Spans, defines the equality between spans.

func (*Span) Less

func (s *Span) Less(b *Span) bool

Less compares two Spans, defines the order between spans.

func (*Span) Marshal

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

func (*Span) MarshalText

func (s *Span) MarshalText() ([]byte, error)

MarshalText implements encoding.TextMarshaler (used in proto.CompactTextString). It is helpful to format span in log.

func (*Span) MarshalTo

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

func (*Span) MarshalToSizedBuffer

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

func (*Span) ProtoMessage

func (*Span) ProtoMessage()

func (*Span) Reset

func (m *Span) Reset()

func (*Span) Size

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

func (*Span) String

func (s *Span) String() string

func (*Span) Unmarshal

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

func (*Span) XXX_DiscardUnknown

func (m *Span) XXX_DiscardUnknown()

func (*Span) XXX_Marshal

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

func (*Span) XXX_Merge

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

func (*Span) XXX_Size

func (m *Span) XXX_Size() int

func (*Span) XXX_Unmarshal

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

type Stats

type Stats struct {
	// Number of captured regions.
	RegionCount uint64 `protobuf:"varint,1,opt,name=region_count,json=regionCount,proto3" json:"region_count,omitempty"`
	// The current timestamp from the table's point of view.
	CurrentTs Ts `protobuf:"varint,2,opt,name=current_ts,json=currentTs,proto3,casttype=Ts" json:"current_ts,omitempty"` // Deprecated: Do not use.
	// Checkponits at each stage.
	StageCheckpoints map[string]Checkpoint `` /* 187-byte string literal not displayed */
	// The barrier timestamp of the table.
	BarrierTs Ts `protobuf:"varint,4,opt,name=barrier_ts,json=barrierTs,proto3,casttype=Ts" json:"barrier_ts,omitempty"`
}

Stats holds a statistic for a table.

func (*Stats) Descriptor

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

func (*Stats) GetBarrierTs

func (m *Stats) GetBarrierTs() Ts

func (*Stats) GetCurrentTs deprecated

func (m *Stats) GetCurrentTs() Ts

Deprecated: Do not use.

func (*Stats) GetRegionCount

func (m *Stats) GetRegionCount() uint64

func (*Stats) GetStageCheckpoints

func (m *Stats) GetStageCheckpoints() map[string]Checkpoint

func (*Stats) Marshal

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

func (*Stats) MarshalTo

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

func (*Stats) MarshalToSizedBuffer

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

func (*Stats) ProtoMessage

func (*Stats) ProtoMessage()

func (*Stats) Reset

func (m *Stats) Reset()

func (*Stats) Size

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

func (*Stats) String

func (m *Stats) String() string

func (*Stats) Unmarshal

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

func (*Stats) XXX_DiscardUnknown

func (m *Stats) XXX_DiscardUnknown()

func (*Stats) XXX_Marshal

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

func (*Stats) XXX_Merge

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

func (*Stats) XXX_Size

func (m *Stats) XXX_Size() int

func (*Stats) XXX_Unmarshal

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

type TableID

type TableID = int64

TableID is the ID of the table

type TableState

type TableState int32

TableState is the state of table replication in processor.

┌────────┐   ┌───────────┐   ┌──────────┐
│ Absent ├─> │ Preparing ├─> │ Prepared │
└────────┘   └───────────┘   └─────┬────┘
                                   v
┌─────────┐   ┌──────────┐   ┌─────────────┐
│ Stopped │ <─┤ Stopping │ <─┤ Replicating │
└─────────┘   └──────────┘   └─────────────┘

TODO rename to TableSpanState.

const (
	TableStateUnknown     TableState = 0
	TableStateAbsent      TableState = 1
	TableStatePreparing   TableState = 2
	TableStatePrepared    TableState = 3
	TableStateReplicating TableState = 4
	TableStateStopping    TableState = 5
	TableStateStopped     TableState = 6
)

func (*TableState) CompareAndSwap

func (s *TableState) CompareAndSwap(old, new TableState) bool

CompareAndSwap is just like sync/atomic.Atomic*.CompareAndSwap.

func (TableState) EnumDescriptor

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

func (*TableState) Load

func (s *TableState) Load() TableState

Load TableState with THREAD-SAFE

func (*TableState) Store

func (s *TableState) Store(new TableState)

Store TableState with THREAD-SAFE

func (TableState) String

func (x TableState) String() string

type TableStatus

type TableStatus struct {
	TableID    TableID    `protobuf:"varint,1,opt,name=table_id,json=tableId,proto3,casttype=TableID" json:"table_id,omitempty"`
	Span       Span       `protobuf:"bytes,5,opt,name=span,proto3" json:"span"`
	State      TableState `protobuf:"varint,2,opt,name=state,proto3,enum=pingcap.tiflow.cdc.processor.tablepb.TableState" json:"state,omitempty"`
	Checkpoint Checkpoint `protobuf:"bytes,3,opt,name=checkpoint,proto3" json:"checkpoint"`
	Stats      Stats      `protobuf:"bytes,4,opt,name=stats,proto3" json:"stats"`
}

TableStatus is the running status of a table. TODO rename to TableStatus.

func (*TableStatus) Descriptor

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

func (*TableStatus) GetCheckpoint

func (m *TableStatus) GetCheckpoint() Checkpoint

func (*TableStatus) GetSpan

func (m *TableStatus) GetSpan() Span

func (*TableStatus) GetState

func (m *TableStatus) GetState() TableState

func (*TableStatus) GetStats

func (m *TableStatus) GetStats() Stats

func (*TableStatus) GetTableID

func (m *TableStatus) GetTableID() TableID

func (*TableStatus) Marshal

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

func (*TableStatus) MarshalTo

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

func (*TableStatus) MarshalToSizedBuffer

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

func (*TableStatus) ProtoMessage

func (*TableStatus) ProtoMessage()

func (*TableStatus) Reset

func (m *TableStatus) Reset()

func (*TableStatus) Size

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

func (*TableStatus) String

func (m *TableStatus) String() string

func (*TableStatus) Unmarshal

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

func (*TableStatus) XXX_DiscardUnknown

func (m *TableStatus) XXX_DiscardUnknown()

func (*TableStatus) XXX_Marshal

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

func (*TableStatus) XXX_Merge

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

func (*TableStatus) XXX_Size

func (m *TableStatus) XXX_Size() int

func (*TableStatus) XXX_Unmarshal

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

type Ts

type Ts = uint64

Ts is the timestamp with a logical count

Jump to

Keyboard shortcuts

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