view

package
v0.0.0-...-8b4c9e6 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2014 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Join  updateType = "+"
	Leave updateType = "-"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CurrentView

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

func NewCurrentView

func NewCurrentView() CurrentView

func (CurrentView) String

func (currentView CurrentView) String() string

func (*CurrentView) Update

func (currentView *CurrentView) Update(newView *View)

func (*CurrentView) View

func (currentView *CurrentView) View() *View

func (*CurrentView) ViewAndViewRef

func (currentView *CurrentView) ViewAndViewRef() (*View, ViewRef)

func (*CurrentView) ViewRef

func (currentView *CurrentView) ViewRef() ViewRef

type OldViewError

type OldViewError struct {
	NewView *View
}

func (OldViewError) Error

func (e OldViewError) Error() string

type Process

type Process struct {
	Addr string
}

func (Process) Less

func (thisProcess Process) Less(otherProcess Process) bool

type Update

type Update struct {
	Type    updateType
	Process Process
}

func (Update) Less

func (thisUpdate Update) Less(otherUpdate Update) bool

type View

type View struct {
	Entries map[Update]bool
	Members map[Process]bool // Cache, can be rebuilt from Entries
}

View represents a server's view of the members of the distributed system. A View once created is immutable, for a mutable View, see CurrentView type.

func NewWithProcesses

func NewWithProcesses(processes ...Process) *View

func NewWithUpdates

func NewWithUpdates(updates ...Update) *View

func (*View) Equal

func (v *View) Equal(v2 *View) bool

func (*View) GetMembers

func (v *View) GetMembers() []Process

func (*View) GetMembersNotIn

func (v *View) GetMembersNotIn(v2 *View) []Process

func (*View) GetProcessPosition

func (v *View) GetProcessPosition(process Process) int

GetProcessPosition returns an unique number for the process in the view. Returns -1 if process is not a member of the view.

func (*View) GetUpdates

func (v *View) GetUpdates() []Update

func (*View) HasMember

func (v *View) HasMember(p Process) bool

func (*View) HasUpdate

func (v *View) HasUpdate(u Update) bool

func (*View) LessUpdatedThan

func (v *View) LessUpdatedThan(v2 *View) bool

func (*View) NewCopyWithUpdates

func (v *View) NewCopyWithUpdates(updates ...Update) *View

func (*View) NumberOfMembers

func (v *View) NumberOfMembers() int

func (*View) NumberOfToleratedFaults

func (v *View) NumberOfToleratedFaults() int

func (*View) NumberOfUpdates

func (v *View) NumberOfUpdates() int

func (*View) QuorumSize

func (v *View) QuorumSize() int

func (*View) String

func (v *View) String() string

type ViewRef

type ViewRef struct {
	Digest [sha1.Size]byte
}

func ViewToViewRef

func ViewToViewRef(v *View) ViewRef

func (ViewRef) String

func (vr ViewRef) String() string

Jump to

Keyboard shortcuts

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