database

package
v0.0.0-...-b371d68 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2024 License: BSD-3-Clause Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DATASUB   = "d"
	NDLOCK    = 2053
	CACHESIZE = 1000
)
View Source
const (
	FLAG_ENCRYPTED_V1 = (1 << 0)
)

Variables

View Source
var (
	ErrInvalidLengthDbwire        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowDbwire          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupDbwire = fmt.Errorf("proto: unexpected end of group")
)

Functions

This section is empty.

Types

type BackEnder

type BackEnder interface {
	Close()
	Get(sub string, key string) ([]byte, bool, error)
	Put(sub string, key string, val []byte) error
	Del(sub string, key string) error
	Range(sub string, start string, end string, lambda func(string, []byte) bool) error
}

type Conf

type Conf struct {
	Name      string
	Expire    uint64
	MyId      string
	DC        string
	Rack      string
	Secret    string
	CacheSize int
	SDB       ring.ConfDBer
	Grpcp     *gclient.Defaults
}

type DB

type DB struct {
	// contains filtered or unexported fields
}

func Open

func Open(be BackEnder, c Conf) *DB

func (*DB) AE

func (db *DB) AE() bool

func (*DB) Close

func (db *DB) Close()

func (*DB) Del

func (db *DB) Del(rec *acproto.ACPY2MapDatum) error

actually remove, not tombstone used primarily for key expiration

func (*DB) DelExpired

func (db *DB) DelExpired(key string, shard uint32, exp uint64)

verify the expiration + delete

func (*DB) DelInternal

func (db *DB) DelInternal(sub string, key string)

func (*DB) Distrib

func (db *DB) Distrib(loc *soty.Loc, req *acproto.ACPY2DistRequest, onDone func(int))

func (*DB) DistribLocal

func (db *DB) DistribLocal(loc *soty.Loc, req *acproto.ACPY2DistRequest, onDone func(int))

func (*DB) ExGet

func (db *DB) ExGet(key string) ([]byte, bool)

func (*DB) ExPut

func (db *DB) ExPut(key string, val []byte)

func (*DB) Get

func (db *DB) Get(rec *acproto.ACPY2MapDatum) (bool, error)

################################################################

func (*DB) GetInternal

func (db *DB) GetInternal(sub string, key string) ([]byte, bool)

func (*DB) GetMerkle

func (db *DB) GetMerkle(level int, treeid uint16, ver uint64) []*merkle.Result

func (*DB) GetRange

func (db *DB) GetRange(req *acproto.ACPY2GetRange, res *acproto.ACPY2GetSet) (bool, error)

func (*DB) GetRingConf

func (db *DB) GetRingConf(dc string) *acproto.ACPY2RingConfReply

func (*DB) IterVersion

func (db *DB) IterVersion(startVer uint64, endVer uint64, lambda func(string, uint64, uint32) bool)

func (*DB) MDel

func (db *DB) MDel(key string)

func (*DB) MGet

func (db *DB) MGet(key string) ([]byte, bool)

func (*DB) MPut

func (db *DB) MPut(key string, val []byte)

func (*DB) PeerUpdate

func (db *DB) PeerUpdate(id string, isup bool, iscf bool, first bool, pd *kibitz.Export, dat *acproto.ACPHeartBeat)

func (*DB) Put

func (db *DB) Put(rec *acproto.ACPY2MapDatum) (int, *soty.Loc)

func (*DB) Range

func (db *DB) Range(sub string, start string, end string, f func(string, []byte) bool)

func (*DB) Redirect

func (db *DB) Redirect(rec *acproto.ACPY2MapDatum)

func (*DB) Repartition

func (db *DB) Repartition(loc *soty.Loc, ver uint64) (bool, uint64)

func (*DB) RingIsStable

func (db *DB) RingIsStable() bool

func (*DB) SetInternal

func (db *DB) SetInternal(sub string, key string, val []byte)

type Record

type Record struct {
	Flags   uint32 `protobuf:"varint,1,opt,name=flags,proto3" json:"flags,omitempty"`
	Shard   uint32 `protobuf:"varint,2,opt,name=shard,proto3" json:"shard,omitempty"`
	Version uint64 `protobuf:"varint,3,opt,name=version,proto3" json:"version,omitempty"`
	Expire  uint64 `protobuf:"varint,4,opt,name=expire,proto3" json:"expire,omitempty"`
	Value   []byte `protobuf:"bytes,5,opt,name=value,proto3" json:"value,omitempty"`
}

func (*Record) Descriptor

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

func (*Record) Equal

func (this *Record) Equal(that interface{}) bool

func (*Record) GetExpire

func (m *Record) GetExpire() uint64

func (*Record) GetFlags

func (m *Record) GetFlags() uint32

func (*Record) GetShard

func (m *Record) GetShard() uint32

func (*Record) GetValue

func (m *Record) GetValue() []byte

func (*Record) GetVersion

func (m *Record) GetVersion() uint64

func (*Record) GoString

func (this *Record) GoString() string

func (*Record) Marshal

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

func (*Record) MarshalTo

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

func (*Record) MarshalToSizedBuffer

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

func (*Record) ProtoMessage

func (*Record) ProtoMessage()

func (*Record) Reset

func (m *Record) Reset()

func (*Record) Size

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

func (*Record) String

func (this *Record) String() string

func (*Record) Unmarshal

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

func (*Record) XXX_DiscardUnknown

func (m *Record) XXX_DiscardUnknown()

func (*Record) XXX_Marshal

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

func (*Record) XXX_Merge

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

func (*Record) XXX_Size

func (m *Record) XXX_Size() int

func (*Record) XXX_Unmarshal

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

Jump to

Keyboard shortcuts

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