Documentation ¶
Index ¶
- func AbortPartition(id uint64, dest RemoteServer) (bool, error)
- func CommitPartition(id uint64, dest RemoteServer) (bool, error)
- func PreCommitPartition(r Ranges, id uint64, dest RemoteServer) (bool, error)
- type Diff
- type PartitionDelegate
- type PartitionSet
- func (pts *PartitionSet) Abort(updateID uint64) bool
- func (t *PartitionSet) AddDaemon(id uint64)
- func (pts *PartitionSet) ApplyCopyDiffs(diffs []Diff) bool
- func (ps *PartitionSet) CalculateDiffs(keys []uint) ([]Diff, *PartitionSet)
- func (t *PartitionSet) CanCommit() bool
- func (pts *PartitionSet) Commit(updateID uint64) bool
- func (t *PartitionSet) Copy() PartitionSet
- func (pts *PartitionSet) GarbageCollect()
- func (pts *PartitionSet) Get(key string) (string, error)
- func (pts *PartitionSet) GetNKeysForEachShard() ([]uint, error)
- func (pts *PartitionSet) GetShardCopies() []ShardCopy
- func (t *PartitionSet) GetShardForKey(key string) Shard
- func (pts *PartitionSet) IDs() [][]uint64
- func (ps *PartitionSet) IntRanges() []uint64
- func (pts *PartitionSet) PreCommit(r Ranges, updateID uint64) bool
- func (pts *PartitionSet) Put(key, value string, options map[string]bool) (error, map[string]string)
- func (ps *PartitionSet) Ranges() []Range
- func (o *PartitionSet) Recalc(keys []uint) PartitionSet
- func (ps *PartitionSet) Verify() bool
- type PreCommitRequest
- type Shard
- func (self *Shard) Copy() *Shard
- func (shard *Shard) CopyKVs(otherShard Shard, start, end uint64) bool
- func (shard *Shard) GarbageCollect()
- func (t *Shard) GetDaemons() map[uint64]bool
- func (shard *Shard) GetInfoForShard() (error, uint)
- func (shard *Shard) IDs() []uint64
- func (shard *Shard) Put(key, value string, options map[string]bool) (error, map[string]string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AbortPartition ¶
func CommitPartition ¶
func PreCommitPartition ¶
Types ¶
type Diff ¶
func GenerateDiffs ¶
func GenerateDiffs(oldPS, newPS PartitionSet) []Diff
type PartitionDelegate ¶
type PartitionSet ¶
type PartitionSet struct { Shards []Shard // contains filtered or unexported fields }
func MakeKeySpace ¶
func MakeKeySpace(n int, del PartitionDelegate) *PartitionSet
n must be a postive power of two, 2 4 8 16 32 etc
func MakePartitionSet ¶
func MakePartitionSet(ns []ShardCopy, del PartitionDelegate) *PartitionSet
func (*PartitionSet) Abort ¶
func (pts *PartitionSet) Abort(updateID uint64) bool
func (*PartitionSet) AddDaemon ¶
func (t *PartitionSet) AddDaemon(id uint64)
function that gets called when a new daemon is commited to the system. Argument : id of the daemon
func (*PartitionSet) ApplyCopyDiffs ¶
func (pts *PartitionSet) ApplyCopyDiffs(diffs []Diff) bool
func (*PartitionSet) CalculateDiffs ¶
func (ps *PartitionSet) CalculateDiffs(keys []uint) ([]Diff, *PartitionSet)
func (*PartitionSet) CanCommit ¶
func (t *PartitionSet) CanCommit() bool
func (*PartitionSet) Commit ¶
func (pts *PartitionSet) Commit(updateID uint64) bool
func (*PartitionSet) Copy ¶
func (t *PartitionSet) Copy() PartitionSet
func (*PartitionSet) GarbageCollect ¶
func (pts *PartitionSet) GarbageCollect()
func (*PartitionSet) GetNKeysForEachShard ¶
func (pts *PartitionSet) GetNKeysForEachShard() ([]uint, error)
func (*PartitionSet) GetShardCopies ¶
func (pts *PartitionSet) GetShardCopies() []ShardCopy
func (*PartitionSet) GetShardForKey ¶
func (t *PartitionSet) GetShardForKey(key string) Shard
func (*PartitionSet) IDs ¶
func (pts *PartitionSet) IDs() [][]uint64
func (*PartitionSet) IntRanges ¶
func (ps *PartitionSet) IntRanges() []uint64
func (*PartitionSet) PreCommit ¶
func (pts *PartitionSet) PreCommit(r Ranges, updateID uint64) bool
func (*PartitionSet) Ranges ¶
func (ps *PartitionSet) Ranges() []Range
func (*PartitionSet) Recalc ¶
func (o *PartitionSet) Recalc(keys []uint) PartitionSet
func (*PartitionSet) Verify ¶
func (ps *PartitionSet) Verify() bool
type PreCommitRequest ¶
type PreCommitRequest struct { R Ranges Id uint64 }
type Shard ¶
type Shard struct { Start uint64 End uint64 Daemons map[uint64]bool Keys uint // contains filtered or unexported fields }
func (*Shard) GarbageCollect ¶
func (shard *Shard) GarbageCollect()
func (*Shard) GetDaemons ¶
func (*Shard) GetInfoForShard ¶
Click to show internal directories.
Click to hide internal directories.