Documentation ¶
Index ¶
- type ActionOp
- type Controller
- type InMemController
- func (imc *InMemController) AttachmentsCh(existing bool) <-chan VolumeAction
- func (imc *InMemController) DefineAttachment(vol *volumesAPI.Volume, isUpdate bool)
- func (imc *InMemController) DefineVolume(vol *volumesAPI.Volume, isUpdate bool)
- func (imc *InMemController) Discover(peer string) (*net.UDPAddr, error)
- func (imc *InMemController) PeerIDs() []string
- func (imc *InMemController) Peers(volumeID string) ([]*PeerInfo, error)
- func (imc *InMemController) Register(id string, addr *net.UDPAddr) error
- func (imc *InMemController) RemoveVolume(id string)
- func (imc *InMemController) VolumesCh(existing bool) <-chan VolumeAction
- type PeerInfo
- type VolumeAction
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Controller ¶
type Controller interface { //VolumesCh provides updates to storage nodes for adding or removing volumes //If existing is true, all existing volumes wil be streamed to the chan VolumesCh(exiting bool) <-chan VolumeAction //AttachmentsCh provides updates to agent nodes for adding or removing volume attachments //If existing is true, all existing attachments wil be streamed to the chan AttachmentsCh(exiting bool) <-chan VolumeAction //Discover provides a mechanism for finding peer endpoints Discover(peer string) (*net.UDPAddr, error) //Register allows a server to register it's endpoint Register(peer string, addr *net.UDPAddr) error //Peers provides information about which peers should contain volumes Peers(volumeID string) ([]*PeerInfo, error) }
Controller provides cluster level management of individual SBS nodes
type InMemController ¶
type InMemController struct { Volumes map[string]*volumesAPI.Volume Attachments map[string]*volumesAPI.Volume // contains filtered or unexported fields }
InMemController in-memory controller; useful for tests Volumes will be assigned to all peers
func NewInMemController ¶
func NewInMemController() *InMemController
NewInMemController provides a new in-memory controller instance for testing
func (*InMemController) AttachmentsCh ¶
func (imc *InMemController) AttachmentsCh(existing bool) <-chan VolumeAction
AttachmentsCh provides updates to agent nodes for adding or removing volume attachments
func (*InMemController) DefineAttachment ¶
func (imc *InMemController) DefineAttachment(vol *volumesAPI.Volume, isUpdate bool)
DefineAttachment adds a new attachment and notifies all peers of new volume
func (*InMemController) DefineVolume ¶
func (imc *InMemController) DefineVolume(vol *volumesAPI.Volume, isUpdate bool)
DefineVolume adds a new volume and notifies all peers of new volume
func (*InMemController) Discover ¶
func (imc *InMemController) Discover(peer string) (*net.UDPAddr, error)
Discover provides a mechanism for finding peer endpoints
func (*InMemController) PeerIDs ¶
func (imc *InMemController) PeerIDs() []string
PeerIDs provides a list of connected peers
func (*InMemController) Peers ¶
func (imc *InMemController) Peers(volumeID string) ([]*PeerInfo, error)
Peers provides information about which peers should contain volumes
func (*InMemController) Register ¶
func (imc *InMemController) Register(id string, addr *net.UDPAddr) error
Register allows a server to register it's endpoint
func (*InMemController) RemoveVolume ¶
func (imc *InMemController) RemoveVolume(id string)
RemoveVolume removes a volme along with attachments and notifies all peers of the change
func (*InMemController) VolumesCh ¶
func (imc *InMemController) VolumesCh(existing bool) <-chan VolumeAction
VolumesCh provides updates to storage nodes for adding or removing volumes
type VolumeAction ¶
type VolumeAction struct { Op ActionOp Desc *volumesAPI.Volume Peers []string }
VolumeAction provides update data of volume changes