Documentation ¶
Overview ¶
Package view implements the view type. A view is a set of processes, and it is used to put together all the system's processes.
Index ¶
- Constants
- type OldViewError
- type Process
- type Update
- type View
- func (v *View) Equal(v2 *View) bool
- func (v *View) GetMembers() []Process
- func (v *View) GetMembersNotIn(v2 *View) []Process
- func (v *View) GetProcessPosition(process Process) int
- func (v *View) GetUpdates() []Update
- func (v *View) HasMember(p Process) bool
- func (v *View) HasUpdate(u Update) bool
- func (v *View) LessUpdatedThan(v2 *View) bool
- func (v *View) MoreUpdatedThan(v2 *View) bool
- func (v *View) NewCopyWithUpdates(updates ...Update) *View
- func (v *View) NumberOfMembers() int
- func (v *View) NumberOfToleratedFaults() int
- func (v *View) NumberOfUpdates() int
- func (v *View) QuorumSize() int
- func (v *View) String() string
- type ViewRef
Constants ¶
View Source
const ( Join updateType = "+" Leave updateType = "-" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type OldViewError ¶
type OldViewError struct {
NewView *View
}
func (OldViewError) Error ¶
func (e OldViewError) Error() string
type View ¶
type View struct { Entries map[Update]bool Members map[Process]bool // Cache, can be rebuilt from Entries ViewRef }
View represents a server's view of the members of the distributed system. A View once created is immutable, for a mutable View, see type CurrentView.
func NewWithProcesses ¶
func NewWithUpdates ¶
func (*View) GetMembers ¶
func (*View) GetMembersNotIn ¶
func (*View) GetProcessPosition ¶
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 (*View) LessUpdatedThan ¶
func (*View) MoreUpdatedThan ¶
func (*View) NewCopyWithUpdates ¶
func (*View) NumberOfMembers ¶
func (*View) NumberOfToleratedFaults ¶
func (*View) NumberOfUpdates ¶
func (*View) QuorumSize ¶
Click to show internal directories.
Click to hide internal directories.