Documentation ¶
Index ¶
- type ServerGroup
- func (sg *ServerGroup) AddServerToGroup(addr string) (*VirtualServer, error)
- func (sg *ServerGroup) DeadServer(addr string) error
- func (sg *ServerGroup) GetAnyHolder(chunkID int) *VirtualServer
- func (sg *ServerGroup) GetChunkHolders(chunkID int) (holders [8]*VirtualServer)
- func (sg *ServerGroup) GetServerChunks(addr string) []protocol.AmAliveChunk
- func (sg *ServerGroup) IsServerOnGroup(addr string) bool
- func (sg *ServerGroup) IsSynched(cid int) bool
- func (sg *ServerGroup) KnownServers() []string
- func (sg *ServerGroup) Marshal() ([]byte, error)
- func (sg *ServerGroup) NumChunks() int
- func (sg *ServerGroup) NumHolders(chunkID int) int
- func (sg *ServerGroup) NumServers() int
- func (sg *ServerGroup) Redundancy() int
- func (sg *ServerGroup) RemoveServer(addr string) error
- func (sg *ServerGroup) ServerAlive(addr string)
- func (sg *ServerGroup) Servers() []*VirtualServer
- func (sg *ServerGroup) SetBuffered()
- func (sg *ServerGroup) SetNoDelay()
- func (sg *ServerGroup) SetServerChunks(addr string, cids []protocol.AmAliveChunk)
- func (sg *ServerGroup) Stop()
- func (sg *ServerGroup) String() string
- func (sg *ServerGroup) UnSynchedChunks() []int
- type VirtualChunk
- type VirtualServer
- func (s *VirtualServer) AddServerToGroup(addr string) error
- func (s *VirtualServer) CAS(key, value []byte, timeout time.Duration) (com.CASOperation, error)
- func (s *VirtualServer) Del(key []byte, value []byte, timeout time.Duration) (com.DelOperation, error)
- func (s *VirtualServer) Get(key []byte, timeout time.Duration) (com.GetOperation, error)
- func (s *VirtualServer) GetAccessInfo() []byte
- func (s *VirtualServer) GetChunkInfo(chunkID int) (size uint64)
- func (s *VirtualServer) Protect(chunkID int) (ok bool)
- func (s *VirtualServer) Set(key, value []byte, timeout time.Duration) (com.SetOperation, error)
- func (s *VirtualServer) SetBuffered() (ok bool)
- func (s *VirtualServer) SetNoDelay() (ok bool)
- func (s *VirtualServer) Transfer(addr string, chunkID int) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ServerGroup ¶
type ServerGroup struct { LocalhostIPPort string //Read-only from external packages // contains filtered or unexported fields }
ServerGroup provides an access to a DB server group
func CreateServerGroup ¶
func CreateServerGroup(numChunks int, redundancy int, LocalhostIPPort string) *ServerGroup
CreateServerGroup creates a new DB server group, without connecting to an existing group
func UnmarhalServerGroup ¶
func UnmarhalServerGroup(serialization []byte) (*ServerGroup, error)
UnmarhalServerGroup unmarshalles serialization creating a new ServerGroup This ServerGroup will be configured (NumChunks and Redundancy), and it will have a server list copy. It won't contain any chunk information.
func (*ServerGroup) AddServerToGroup ¶
func (sg *ServerGroup) AddServerToGroup(addr string) (*VirtualServer, error)
func (*ServerGroup) DeadServer ¶
func (sg *ServerGroup) DeadServer(addr string) error
func (*ServerGroup) GetAnyHolder ¶
func (sg *ServerGroup) GetAnyHolder(chunkID int) *VirtualServer
func (*ServerGroup) GetChunkHolders ¶
func (sg *ServerGroup) GetChunkHolders(chunkID int) (holders [8]*VirtualServer)
func (*ServerGroup) GetServerChunks ¶
func (sg *ServerGroup) GetServerChunks(addr string) []protocol.AmAliveChunk
func (*ServerGroup) IsServerOnGroup ¶
func (sg *ServerGroup) IsServerOnGroup(addr string) bool
func (*ServerGroup) IsSynched ¶
func (sg *ServerGroup) IsSynched(cid int) bool
func (*ServerGroup) KnownServers ¶
func (sg *ServerGroup) KnownServers() []string
func (*ServerGroup) Marshal ¶
func (sg *ServerGroup) Marshal() ([]byte, error)
Marshal DB configuration and server addresses
func (*ServerGroup) NumChunks ¶
func (sg *ServerGroup) NumChunks() int
func (*ServerGroup) NumHolders ¶
func (sg *ServerGroup) NumHolders(chunkID int) int
func (*ServerGroup) NumServers ¶
func (sg *ServerGroup) NumServers() int
func (*ServerGroup) Redundancy ¶
func (sg *ServerGroup) Redundancy() int
func (*ServerGroup) RemoveServer ¶
func (sg *ServerGroup) RemoveServer(addr string) error
func (*ServerGroup) ServerAlive ¶
func (sg *ServerGroup) ServerAlive(addr string)
func (*ServerGroup) Servers ¶
func (sg *ServerGroup) Servers() []*VirtualServer
func (*ServerGroup) SetBuffered ¶
func (sg *ServerGroup) SetBuffered()
func (*ServerGroup) SetNoDelay ¶
func (sg *ServerGroup) SetNoDelay()
func (*ServerGroup) SetServerChunks ¶
func (sg *ServerGroup) SetServerChunks(addr string, cids []protocol.AmAliveChunk)
func (*ServerGroup) Stop ¶
func (sg *ServerGroup) Stop()
func (*ServerGroup) String ¶
func (sg *ServerGroup) String() string
String returns a human-readable representation of the server group
func (*ServerGroup) UnSynchedChunks ¶
func (sg *ServerGroup) UnSynchedChunks() []int
type VirtualChunk ¶
type VirtualChunk struct {
// contains filtered or unexported fields
}
VirtualChunk stores generical chunk info, including server holders
func (*VirtualChunk) String ¶
func (c *VirtualChunk) String()
type VirtualServer ¶
type VirtualServer struct { Phy string //Physical address. READ-ONLY by external packages!!! // contains filtered or unexported fields }
VirtualServer stores generical server info
func (*VirtualServer) AddServerToGroup ¶
func (s *VirtualServer) AddServerToGroup(addr string) error
AddServerToGroup request to add this server to the server group
func (*VirtualServer) CAS ¶
func (s *VirtualServer) CAS(key, value []byte, timeout time.Duration) (com.CASOperation, error)
Set a new key/value pair
func (*VirtualServer) Del ¶
func (s *VirtualServer) Del(key []byte, value []byte, timeout time.Duration) (com.DelOperation, error)
Del deletes a key/value pair
func (*VirtualServer) Get ¶
func (s *VirtualServer) Get(key []byte, timeout time.Duration) (com.GetOperation, error)
Get the value of key
func (*VirtualServer) GetAccessInfo ¶
func (s *VirtualServer) GetAccessInfo() []byte
GetAccessInfo request DB access info
func (*VirtualServer) GetChunkInfo ¶
func (s *VirtualServer) GetChunkInfo(chunkID int) (size uint64)
GetChunkInfo request chunk info
func (*VirtualServer) Protect ¶
func (s *VirtualServer) Protect(chunkID int) (ok bool)
func (*VirtualServer) Set ¶
func (s *VirtualServer) Set(key, value []byte, timeout time.Duration) (com.SetOperation, error)
Set a new key/value pair
func (*VirtualServer) SetBuffered ¶
func (s *VirtualServer) SetBuffered() (ok bool)
func (*VirtualServer) SetNoDelay ¶
func (s *VirtualServer) SetNoDelay() (ok bool)