server

package
v0.0.0-...-1a21ecf Latest Latest
Warning

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

Go to latest
Published: May 8, 2015 License: MIT Imports: 13 Imported by: 1

Documentation

Overview

Package server implements a Freestore server.

Index

Constants

View Source
const (
	CHANNEL_DEFAULT_SIZE = 20
)
View Source
const CONSENSUS_LEADER_PROCESS_POSITION int = 0

Variables

This section is empty.

Functions

This section is empty.

Types

type AdminService

type AdminService struct{}

func (*AdminService) Leave

func (r *AdminService) Leave(anything struct{}, reply *struct{}) error

type InstallSeq

type InstallSeq struct {
	InstallView    *view.View
	ViewSeq        ViewSeq
	AssociatedView *view.View
}

func (InstallSeq) Equal

func (installSeq InstallSeq) Equal(installSeq2 InstallSeq) bool

type InstallSeqMsg

type InstallSeqMsg struct {
	Sender view.Process
	InstallSeq
}

func (InstallSeqMsg) Equal

func (installSeqMsg InstallSeqMsg) Equal(installSeqMsg2 InstallSeqMsg) bool

func (InstallSeqMsg) String

func (installSeq InstallSeqMsg) String() string

type ReconfigMsg

type ReconfigMsg struct {
	Update         view.Update
	AssociatedView *view.View
}

type ReconfigurationRequest

type ReconfigurationRequest int

func (*ReconfigurationRequest) InstallSeq

func (r *ReconfigurationRequest) InstallSeq(arg InstallSeqMsg, reply *struct{}) error

func (*ReconfigurationRequest) Reconfig

func (r *ReconfigurationRequest) Reconfig(arg ReconfigMsg, reply *struct{}) error

func (*ReconfigurationRequest) StateUpdate

func (r *ReconfigurationRequest) StateUpdate(arg SyncStateMsg, reply *struct{}) error

func (*ReconfigurationRequest) ViewInstalled

func (r *ReconfigurationRequest) ViewInstalled(arg ViewInstalledMsg, reply *struct{}) error

type RegisterService

type RegisterService struct{}

func (*RegisterService) GetCurrentView

func (r *RegisterService) GetCurrentView(anything struct{}, reply **view.View) error

func (*RegisterService) Read

func (r *RegisterService) Read(clientViewRef view.ViewRef, reply *Value) error

func (*RegisterService) Write

func (r *RegisterService) Write(value Value, reply *Value) error

type RegisterValue

type RegisterValue struct {
	Value     interface{}
	Timestamp uint64
}

type SeqConv

type SeqConv struct {
	Seq ViewSeq
}

-------- REQUESTS -----------

func (SeqConv) Equal

func (seqConv SeqConv) Equal(seqConv2 SeqConv) bool

type SeqConvMsg

type SeqConvMsg struct {
	AssociatedView *view.View
	SeqConv
}

type Server

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

func New

func New(bindAddr string, initialView *view.View, useConsensusArg bool) (*Server, error)

New creates a new server that will listen to bindAddr, use the initialView and use or not consensus when a reconfiguration is required.

func (*Server) Run

func (s *Server) Run()

type State

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

func (State) NewCopy

func (thisState State) NewCopy() State

type Storage

type Storage interface {
	Read(name string) (RegisterValue, error)
	Write(name string, value RegisterValue) error
	LockAll()
	UnlockAll()
}

TODO Add state synchronization logic to Storage

type SyncStateMsg

type SyncStateMsg struct {
	Value          interface{}
	Timestamp      int
	Recv           map[view.Update]bool
	AssociatedView *view.View
}

type Value

type Value struct {
	Value     interface{}
	Timestamp int

	ViewRef view.ViewRef
	Err     error
	// contains filtered or unexported fields
}

type ViewGeneratorRequest

type ViewGeneratorRequest int

func (*ViewGeneratorRequest) ProposeSeqView

func (r *ViewGeneratorRequest) ProposeSeqView(arg ViewSeqMsg, reply *struct{}) error

func (*ViewGeneratorRequest) SeqConv

func (r *ViewGeneratorRequest) SeqConv(arg SeqConvMsg, reply *struct{}) error

type ViewInstalledMsg

type ViewInstalledMsg struct {
	InstalledView *view.View
}

type ViewSeq

type ViewSeq []*view.View

func (ViewSeq) Append

func (viewSeq ViewSeq) Append(views ...*view.View) ViewSeq

func (ViewSeq) Equal

func (viewSeq ViewSeq) Equal(otherViewSeq ViewSeq) bool

func (ViewSeq) GetLeastUpdatedView

func (viewSeq ViewSeq) GetLeastUpdatedView() *view.View

func (ViewSeq) GetMostUpdatedView

func (viewSeq ViewSeq) GetMostUpdatedView() *view.View

func (ViewSeq) HasView

func (viewSeq ViewSeq) HasView(view *view.View) bool

func (ViewSeq) HasViewMoreUpdatedThan

func (viewSeq ViewSeq) HasViewMoreUpdatedThan(otherView *view.View) bool

type ViewSeqMsg

type ViewSeqMsg struct {
	Sender           view.Process
	AssociatedView   *view.View
	ProposedSeq      ViewSeq
	LastConvergedSeq ViewSeq
}

func (ViewSeqMsg) SameButDifferentSender

func (thisViewSeqMsg ViewSeqMsg) SameButDifferentSender(otherViewSeqMsg ViewSeqMsg) bool

Jump to

Keyboard shortcuts

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