kvrows

package
v0.0.0-...-29fee77 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2022 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ProposalVersion = math.MaxUint64
)

Variables

View Source
var (
	TransactionState_name = map[int32]string{
		0: "Active",
		1: "Committed",
		2: "Aborted",
	}
	TransactionState_value = map[string]int32{
		"Active":    0,
		"Committed": 1,
		"Aborted":   2,
	}
)

Enum value maps for TransactionState.

View Source
var File_rowdata_proto protoreflect.FileDescriptor

Functions

func NewBBoltStore

func NewBBoltStore(dataDir string) (*storage.Store, error)

func NewBTreeStore

func NewBTreeStore() (*storage.Store, error)

func NewBadgerStore

func NewBadgerStore(dataDir string, logger *log.Logger) (*storage.Store, error)

func NewPebbleStore

func NewPebbleStore(dataDir string, logger *log.Logger) (*storage.Store, error)

Types

type Iterator

type Iterator interface {
	Item(fn func(key, val []byte) error) error
	Close()
}

type KV

type KV interface {
	Iterate(minKey, maxKey []byte) (Iterator, error)
	Updater() (Updater, error)
}

func MakeBBoltKV

func MakeBBoltKV(dataDir string) (KV, error)

func MakeBTreeKV

func MakeBTreeKV() (KV, error)

func MakeBadgerKV

func MakeBadgerKV(dataDir string, logger *log.Logger) (KV, error)

func MakePebbleKV

func MakePebbleKV(dataDir string, logger *log.Logger) (KV, error)

type ProposalData

type ProposalData struct {
	TXID    uint64            `protobuf:"varint,1,opt,name=TXID,proto3" json:"TXID,omitempty"`
	Updates []*ProposedUpdate `protobuf:"bytes,2,rep,name=Updates,proto3" json:"Updates,omitempty"`
	// contains filtered or unexported fields
}

func (*ProposalData) Descriptor deprecated

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

Deprecated: Use ProposalData.ProtoReflect.Descriptor instead.

func (*ProposalData) GetTXID

func (x *ProposalData) GetTXID() uint64

func (*ProposalData) GetUpdates

func (x *ProposalData) GetUpdates() []*ProposedUpdate

func (*ProposalData) ProtoMessage

func (*ProposalData) ProtoMessage()

func (*ProposalData) ProtoReflect

func (x *ProposalData) ProtoReflect() protoreflect.Message

func (*ProposalData) Reset

func (x *ProposalData) Reset()

func (*ProposalData) String

func (x *ProposalData) String() string

type ProposedUpdate

type ProposedUpdate struct {
	SID   uint32 `protobuf:"varint,1,opt,name=SID,proto3" json:"SID,omitempty"` // Statement ID
	Value []byte `protobuf:"bytes,2,opt,name=Value,proto3" json:"Value,omitempty"`
	// contains filtered or unexported fields
}

func (*ProposedUpdate) Descriptor deprecated

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

Deprecated: Use ProposedUpdate.ProtoReflect.Descriptor instead.

func (*ProposedUpdate) GetSID

func (x *ProposedUpdate) GetSID() uint32

func (*ProposedUpdate) GetValue

func (x *ProposedUpdate) GetValue() []byte

func (*ProposedUpdate) ProtoMessage

func (*ProposedUpdate) ProtoMessage()

func (*ProposedUpdate) ProtoReflect

func (x *ProposedUpdate) ProtoReflect() protoreflect.Message

func (*ProposedUpdate) Reset

func (x *ProposedUpdate) Reset()

func (*ProposedUpdate) String

func (x *ProposedUpdate) String() string

type RowData

type RowData struct {
	Proposal *ProposalData `protobuf:"bytes,1,opt,name=Proposal,proto3" json:"Proposal,omitempty"`
	Rows     []*RowValue   `protobuf:"bytes,2,rep,name=Rows,proto3" json:"Rows,omitempty"`
	// contains filtered or unexported fields
}

func (*RowData) Descriptor deprecated

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

Deprecated: Use RowData.ProtoReflect.Descriptor instead.

func (*RowData) GetProposal

func (x *RowData) GetProposal() *ProposalData

func (*RowData) GetRows

func (x *RowData) GetRows() []*RowValue

func (*RowData) ProtoMessage

func (*RowData) ProtoMessage()

func (*RowData) ProtoReflect

func (x *RowData) ProtoReflect() protoreflect.Message

func (*RowData) Reset

func (x *RowData) Reset()

func (*RowData) String

func (x *RowData) String() string

type RowValue

type RowValue struct {
	Version uint64 `protobuf:"varint,1,opt,name=Version,proto3" json:"Version,omitempty"`
	Value   []byte `protobuf:"bytes,2,opt,name=Value,proto3" json:"Value,omitempty"`
	// contains filtered or unexported fields
}

func (*RowValue) Descriptor deprecated

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

Deprecated: Use RowValue.ProtoReflect.Descriptor instead.

func (*RowValue) GetValue

func (x *RowValue) GetValue() []byte

func (*RowValue) GetVersion

func (x *RowValue) GetVersion() uint64

func (*RowValue) ProtoMessage

func (*RowValue) ProtoMessage()

func (*RowValue) ProtoReflect

func (x *RowValue) ProtoReflect() protoreflect.Message

func (*RowValue) Reset

func (x *RowValue) Reset()

func (*RowValue) String

func (x *RowValue) String() string

type TransactionData

type TransactionData struct {
	Epoch       uint64           `protobuf:"varint,1,opt,name=Epoch,proto3" json:"Epoch,omitempty"`
	State       TransactionState `protobuf:"varint,2,opt,name=State,proto3,enum=TransactionState" json:"State,omitempty"`
	Version     uint64           `protobuf:"varint,3,opt,name=Version,proto3" json:"Version,omitempty"`
	UpdatedKeys [][]byte         `protobuf:"bytes,4,rep,name=UpdatedKeys,proto3" json:"UpdatedKeys,omitempty"`
	// contains filtered or unexported fields
}

func (*TransactionData) Descriptor deprecated

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

Deprecated: Use TransactionData.ProtoReflect.Descriptor instead.

func (*TransactionData) GetEpoch

func (x *TransactionData) GetEpoch() uint64

func (*TransactionData) GetState

func (x *TransactionData) GetState() TransactionState

func (*TransactionData) GetUpdatedKeys

func (x *TransactionData) GetUpdatedKeys() [][]byte

func (*TransactionData) GetVersion

func (x *TransactionData) GetVersion() uint64

func (*TransactionData) ProtoMessage

func (*TransactionData) ProtoMessage()

func (*TransactionData) ProtoReflect

func (x *TransactionData) ProtoReflect() protoreflect.Message

func (*TransactionData) Reset

func (x *TransactionData) Reset()

func (*TransactionData) String

func (x *TransactionData) String() string

type TransactionState

type TransactionState int32
const (
	TransactionState_Active    TransactionState = 0
	TransactionState_Committed TransactionState = 1
	TransactionState_Aborted   TransactionState = 2
)

func (TransactionState) Descriptor

func (TransactionState) Enum

func (TransactionState) EnumDescriptor deprecated

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

Deprecated: Use TransactionState.Descriptor instead.

func (TransactionState) Number

func (TransactionState) String

func (x TransactionState) String() string

func (TransactionState) Type

type Updater

type Updater interface {
	// Update is atomic for an individual key.
	Update(key []byte, fn func(val []byte) ([]byte, error)) error
	Commit(sync bool) error
	Rollback()
}

Jump to

Keyboard shortcuts

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