Documentation ¶
Index ¶
- Constants
- func HKey(name, key string) uint64
- func SetHashFunc(h hasher.Hasher)
- type Fragment
- type Kind
- type Partition
- func (p *Partition) ID() uint64
- func (p *Partition) Kind() Kind
- func (p *Partition) Length() int
- func (p *Partition) Map() *sync.Map
- func (p *Partition) Owner() discovery.Member
- func (p *Partition) OwnerCount() int
- func (p *Partition) Owners() []discovery.Member
- func (p *Partition) SetOwners(owners []discovery.Member)
- type Partitions
- func (ps *Partitions) PartitionByHKey(hkey uint64) *Partition
- func (ps *Partitions) PartitionByID(partID uint64) *Partition
- func (ps *Partitions) PartitionIDByHKey(hkey uint64) uint64
- func (ps *Partitions) PartitionOwnersByHKey(hkey uint64) []discovery.Member
- func (ps *Partitions) PartitionOwnersByID(partID uint64) []discovery.Member
Constants ¶
View Source
const ( PRIMARY = Kind(iota + 1) BACKUP )
Variables ¶
This section is empty.
Functions ¶
func SetHashFunc ¶
Types ¶
type Partition ¶
Partition is a basic, logical storage unit in Olric and stores DMaps in a sync.Map.
func (*Partition) OwnerCount ¶
OwnerCount returns the current Owner count of a partition.
type Partitions ¶
type Partitions struct {
// contains filtered or unexported fields
}
func New ¶
func New(count uint64, kind Kind) *Partitions
func (*Partitions) PartitionByHKey ¶
func (ps *Partitions) PartitionByHKey(hkey uint64) *Partition
PartitionByHKey returns the partition for the given HKey
func (*Partitions) PartitionByID ¶
func (ps *Partitions) PartitionByID(partID uint64) *Partition
PartitionByID returns the partition for the given HKey
func (*Partitions) PartitionIDByHKey ¶
func (ps *Partitions) PartitionIDByHKey(hkey uint64) uint64
PartitionIDByHKey returns partition ID for a given HKey.
func (*Partitions) PartitionOwnersByHKey ¶
func (ps *Partitions) PartitionOwnersByHKey(hkey uint64) []discovery.Member
PartitionOwnersByHKey loads the partition owners list for a given hkey.
func (*Partitions) PartitionOwnersByID ¶
func (ps *Partitions) PartitionOwnersByID(partID uint64) []discovery.Member
PartitionOwnersByID loads the partition owners list for a given hkey.
Click to show internal directories.
Click to hide internal directories.