merkle

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: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MAXAE    = 20
	BUFSZ    = 1000
	MINBUF   = 4
	MAXFETCH = 256
	TIMEOUT  = 30 * time.Second
	TOONEW   = uint64(60 * time.Second)
)
View Source
const (
	F16       = 0xFFFFFFFFFFFFFFFF
	HEIGHT    = 10
	NLOCK     = 137
	HASHLEN   = 16
	CHQLEN    = 10000
	MAXTODO   = 1000
	MAXREPART = 10240
)

Variables

View Source
var (
	ErrInvalidLengthMerkwire        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowMerkwire          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupMerkwire = fmt.Errorf("proto: unexpected end of group")
)

Functions

This section is empty.

Types

type D

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

func New

func New(name string, db MStorer, expire uint64, grpcp *gclient.Defaults) *D

func (*D) AE

func (m *D) AE(loc *soty.Loc, peer string, ring Ringerizer) (bool, int64, int64)

func (*D) Add

func (m *D) Add(key string, ver uint64, loc *soty.Loc, shard uint32, fixme bool)

func (*D) Close

func (m *D) Close()

func (*D) Del

func (m *D) Del(key string, ver uint64, loc *soty.Loc)

func (*D) FixLeaf

func (m *D) FixLeaf(ver uint64, treeid uint16)

func (*D) GetResponse

func (m *D) GetResponse(level int, treeid uint16, ver uint64) []*Result

func (*D) IterVersion

func (m *D) IterVersion(treeid uint16, startVer uint64, endVer uint64, lambda func(string, uint64, uint32) bool)

func (*D) Move

func (m *D) Move(key string, ver uint64, shard uint32, oldLoc *soty.Loc, newLoc *soty.Loc)

func (*D) RemoveTree

func (m *D) RemoveTree(ring Ringerizer, loc *soty.Loc, peer string)

func (*D) Repartition

func (m *D) Repartition(ring Ringerizer, loc *soty.Loc, ver uint64) (bool, uint64)

func (*D) Xfer

func (m *D) Xfer(key string, ver uint64, oldLoc *soty.Loc, newLoc *soty.Loc)

type LeafSave

type LeafSave struct {
	Version uint64 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"`
	Shard   uint32 `protobuf:"varint,2,opt,name=shard,proto3" json:"shard,omitempty"`
	Key     string `protobuf:"bytes,3,opt,name=key,proto3" json:"key,omitempty"`
}

func (*LeafSave) Descriptor

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

func (*LeafSave) Equal

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

func (*LeafSave) GetKey

func (m *LeafSave) GetKey() string

func (*LeafSave) GetShard

func (m *LeafSave) GetShard() uint32

func (*LeafSave) GetVersion

func (m *LeafSave) GetVersion() uint64

func (*LeafSave) GoString

func (this *LeafSave) GoString() string

func (*LeafSave) Marshal

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

func (*LeafSave) MarshalTo

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

func (*LeafSave) MarshalToSizedBuffer

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

func (*LeafSave) ProtoMessage

func (*LeafSave) ProtoMessage()

func (*LeafSave) Reset

func (m *LeafSave) Reset()

func (*LeafSave) Size

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

func (*LeafSave) String

func (this *LeafSave) String() string

func (*LeafSave) Unmarshal

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

func (*LeafSave) XXX_DiscardUnknown

func (m *LeafSave) XXX_DiscardUnknown()

func (*LeafSave) XXX_Marshal

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

func (*LeafSave) XXX_Merge

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

func (*LeafSave) XXX_Size

func (m *LeafSave) XXX_Size() int

func (*LeafSave) XXX_Unmarshal

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

type LeafSaves

type LeafSaves struct {
	Save []*LeafSave `protobuf:"bytes,1,rep,name=save,proto3" json:"save,omitempty"`
}

func (*LeafSaves) Descriptor

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

func (*LeafSaves) Equal

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

func (*LeafSaves) GetSave

func (m *LeafSaves) GetSave() []*LeafSave

func (*LeafSaves) GoString

func (this *LeafSaves) GoString() string

func (*LeafSaves) Len

func (l *LeafSaves) Len() int

func (*LeafSaves) Less

func (l *LeafSaves) Less(i int, j int) bool

func (*LeafSaves) Marshal

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

func (*LeafSaves) MarshalTo

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

func (*LeafSaves) MarshalToSizedBuffer

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

func (*LeafSaves) ProtoMessage

func (*LeafSaves) ProtoMessage()

func (*LeafSaves) Reset

func (m *LeafSaves) Reset()

func (*LeafSaves) Size

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

func (*LeafSaves) String

func (this *LeafSaves) String() string

func (*LeafSaves) Swap

func (l *LeafSaves) Swap(i int, j int)

func (*LeafSaves) Unmarshal

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

func (*LeafSaves) XXX_DiscardUnknown

func (m *LeafSaves) XXX_DiscardUnknown()

func (*LeafSaves) XXX_Marshal

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

func (*LeafSaves) XXX_Merge

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

func (*LeafSaves) XXX_Size

func (m *LeafSaves) XXX_Size() int

func (*LeafSaves) XXX_Unmarshal

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

type MStorer

type MStorer interface {
	Get(rec *acproto.ACPY2MapDatum) (bool, error)
	Put(rec *acproto.ACPY2MapDatum) (int, *soty.Loc)
	Del(rec *acproto.ACPY2MapDatum) error
	MGet(string) ([]byte, bool)
	MPut(string, []byte)
	MDel(string)
	Range(string, string, string, func(string, []byte) bool)
	DistribLocal(*soty.Loc, *acproto.ACPY2DistRequest, func(int))
}

type NodeSave

type NodeSave struct {
	KeyCount int64  `protobuf:"varint,1,opt,name=key_count,json=keyCount,proto3" json:"key_count,omitempty"`
	Slot     int32  `protobuf:"varint,2,opt,name=slot,proto3" json:"slot,omitempty"`
	Children int32  `protobuf:"varint,3,opt,name=children,proto3" json:"children,omitempty"`
	Hash     []byte `protobuf:"bytes,4,opt,name=hash,proto3" json:"hash,omitempty"`
}

func (*NodeSave) Descriptor

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

func (*NodeSave) Equal

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

func (*NodeSave) GetChildren

func (m *NodeSave) GetChildren() int32

func (*NodeSave) GetHash

func (m *NodeSave) GetHash() []byte

func (*NodeSave) GetKeyCount

func (m *NodeSave) GetKeyCount() int64

func (*NodeSave) GetSlot

func (m *NodeSave) GetSlot() int32

func (*NodeSave) GoString

func (this *NodeSave) GoString() string

func (*NodeSave) Marshal

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

func (*NodeSave) MarshalTo

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

func (*NodeSave) MarshalToSizedBuffer

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

func (*NodeSave) ProtoMessage

func (*NodeSave) ProtoMessage()

func (*NodeSave) Reset

func (m *NodeSave) Reset()

func (*NodeSave) Size

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

func (*NodeSave) String

func (this *NodeSave) String() string

func (*NodeSave) Unmarshal

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

func (*NodeSave) XXX_DiscardUnknown

func (m *NodeSave) XXX_DiscardUnknown()

func (*NodeSave) XXX_Marshal

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

func (*NodeSave) XXX_Merge

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

func (*NodeSave) XXX_Size

func (m *NodeSave) XXX_Size() int

func (*NodeSave) XXX_Unmarshal

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

type NodeSaves

type NodeSaves struct {
	Save []*NodeSave `protobuf:"bytes,1,rep,name=save,proto3" json:"save,omitempty"`
}

func (*NodeSaves) Descriptor

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

func (*NodeSaves) Equal

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

func (*NodeSaves) GetSave

func (m *NodeSaves) GetSave() []*NodeSave

func (*NodeSaves) GoString

func (this *NodeSaves) GoString() string

func (*NodeSaves) Len

func (l *NodeSaves) Len() int

func (*NodeSaves) Less

func (l *NodeSaves) Less(i int, j int) bool

func (*NodeSaves) Marshal

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

func (*NodeSaves) MarshalTo

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

func (*NodeSaves) MarshalToSizedBuffer

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

func (*NodeSaves) ProtoMessage

func (*NodeSaves) ProtoMessage()

func (*NodeSaves) Reset

func (m *NodeSaves) Reset()

func (*NodeSaves) Size

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

func (*NodeSaves) String

func (this *NodeSaves) String() string

func (*NodeSaves) Swap

func (l *NodeSaves) Swap(i int, j int)

func (*NodeSaves) Unmarshal

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

func (*NodeSaves) XXX_DiscardUnknown

func (m *NodeSaves) XXX_DiscardUnknown()

func (*NodeSaves) XXX_Marshal

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

func (*NodeSaves) XXX_Merge

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

func (*NodeSaves) XXX_Size

func (m *NodeSaves) XXX_Size() int

func (*NodeSaves) XXX_Unmarshal

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

type Result

type Result struct {
	Map      string
	Level    int
	TreeID   uint16
	Version  uint64
	Shard    uint32
	Key      string
	Hash     []byte
	KeyCount int64
	Children int
	IsValid  bool
}

type Ringerizer

type Ringerizer interface {
	RandomAEPeer(*soty.Loc) string
	GetLoc(uint32) *soty.Loc
	IsStable() bool
	NumReplicas() int
}

Jump to

Keyboard shortcuts

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