Documentation ¶
Index ¶
- Constants
- func FireTest(ip, port, ipSucc, portSucc string)
- func JoinTest(ip, port, ipSucc, portSucc string)
- func KMP(haystack string, needle string) []int
- func NewRPCServer(n *Node) *rpc.Server
- func RunServer(s *rpc.Server, addr Address, stopC chan struct{})
- func SearchNext(haystack string, needle string) int
- func SearchString(haystack string, needle string) int
- func SelfTest(ip, port, ipSucc, portSucc string)
- func SleepTest(ip, port, ipSucc, portSucc string)
- func StabilizeTest(ip, port, ipSucc, portSucc string)
- type Address
- type Agent
- type Comunication
- type Config
- type DBChord
- type DataBasePl
- type DataBasePlatform
- type DataKeyRequest
- type DataResponse
- type EmptyRequest
- type EmptyResponse
- type KeyRequest
- type Node
- func (n *Node) AskForAKey(addr Address, key []byte) ([]byte, error)
- func (n *Node) Delete(name string, fun string) error
- func (n *Node) DeleteResource(request *KeyRequest, response *EmptyResponse) error
- func (n *Node) GetByName(agentName string) ([]byte, error)
- func (n *Node) GetPredecessorOf(addr Address) (*NodeInfo, error)
- func (n *Node) GetPredecessorOfRPC(request *EmptyRequest, response *NodeInfoResponse) error
- func (n *Node) GetResource(request *KeyRequest, response *DataResponse) error
- func (n *Node) GetSuccessorOf(addr Address) (*NodeInfo, error)
- func (n *Node) GetSuccessorOfKey(addr Address, key []byte) (*NodeInfo, error)
- func (n *Node) GetSuccessorOfKeyRPC(resquest *KeyRequest, response *NodeInfoResponse) error
- func (n *Node) GetSuccessorRPC(request *EmptyRequest, response *NodeInfoResponse) error
- func (n *Node) Join(knowNode *NodeInfo) error
- func (n *Node) MakePingRPC(request *EmptyRequest, response *EmptyResponse) error
- func (n *Node) Notify(addr Address) error
- func (n *Node) NotifyNode(request *NodeInfoRequest, response *EmptyResponse) error
- func (n *Node) Ping(addr Address) bool
- func (n *Node) SaveResource(request *DataKeyRequest, response *EmptyResponse) error
- func (n *Node) SendDelete(addr Address, key []byte) error
- func (n *Node) SendSet(addr Address, key, data []byte) error
- func (n *Node) Set(name string, fun string, data []byte) error
- func (n *Node) Stop()
- func (n *Node) Update(name string, data []byte) error
- type NodeInfo
- type NodeInfoRequest
- type NodeInfoResponse
- type PingResquestError
- type RowData
- type StorageError
Constants ¶
View Source
const ( Names string = "Names" Funs string = "Functions" )
View Source
const (
PatternSize int = 100
)
Variables ¶
This section is empty.
Functions ¶
func NewRPCServer ¶
func SearchString ¶
Search First Position String
func StabilizeTest ¶
func StabilizeTest(ip, port, ipSucc, portSucc string)
Types ¶
type Comunication ¶
type Comunication interface { GetSuccessorOf(Address) (NodeInfo, error) GetSuccessorOfKey(Address, []byte) (NodeInfo, error) GetPredecessorOf(Address) (NodeInfo, error) Notify(Address) error Ping(Address) bool AskForAKey(Address, []byte) (string, error) }
Interface for comunication between Chord nodes All nodes have to implemet the interface
type Config ¶
func DefaultConfig ¶
func DefaultConfig() *Config
type DataBasePl ¶
type DataBasePl struct {
// contains filtered or unexported fields
}
Base de Datos para la plataforma
func NewDataBase ¶
func NewDataBase(fileName string) *DataBasePl
func (*DataBasePl) Delete ¶
func (db *DataBasePl) Delete(vKey []byte) error
func (*DataBasePl) GetAll ¶
func (db *DataBasePl) GetAll() ([][]byte, error)
type DataBasePlatform ¶
type DataKeyRequest ¶
type DataResponse ¶
type DataResponse struct {
Data []byte
}
type KeyRequest ¶
type KeyRequest struct{ Key []byte }
type Node ¶
type Node struct { Info NodeInfo // contains filtered or unexported fields }
func (*Node) AskForAKey ¶
Storage Methods
func (*Node) DeleteResource ¶
func (n *Node) DeleteResource(request *KeyRequest, response *EmptyResponse) error
func (*Node) GetPredecessorOf ¶
Get the predecessor of nodeInfo
func (*Node) GetPredecessorOfRPC ¶
func (n *Node) GetPredecessorOfRPC(request *EmptyRequest, response *NodeInfoResponse) error
Exported rpc method for getPredecessor
func (*Node) GetResource ¶
func (n *Node) GetResource(request *KeyRequest, response *DataResponse) error
func (*Node) GetSuccessorOf ¶
GetSuccessor -> Comunication interface implementation
func (*Node) GetSuccessorOfKey ¶
Ask node at address addr for the successor of key
func (*Node) GetSuccessorOfKeyRPC ¶
func (n *Node) GetSuccessorOfKeyRPC(resquest *KeyRequest, response *NodeInfoResponse) error
Exported rpc method for GetSuccessorOfKey
func (*Node) GetSuccessorRPC ¶
func (n *Node) GetSuccessorRPC(request *EmptyRequest, response *NodeInfoResponse) error
Exported rpc method for GetSuccessor
func (*Node) Join ¶
Join node n to Chord Ring If knowNode is nil then n is the only node In the Ring
func (*Node) MakePingRPC ¶
func (n *Node) MakePingRPC(request *EmptyRequest, response *EmptyResponse) error
func (*Node) NotifyNode ¶
func (n *Node) NotifyNode(request *NodeInfoRequest, response *EmptyResponse) error
Exported rpc method for notify
func (*Node) SaveResource ¶
func (n *Node) SaveResource(request *DataKeyRequest, response *EmptyResponse) error
type NodeInfoRequest ¶
type NodeInfoRequest struct{ NInfo *NodeInfo }
type NodeInfoResponse ¶
type PingResquestError ¶
type PingResquestError struct{}
Alive error
func (PingResquestError) Error ¶
func (p PingResquestError) Error() string
type StorageError ¶
type StorageError struct {
// contains filtered or unexported fields
}
Errors
func (StorageError) Error ¶
func (se StorageError) Error() string
Click to show internal directories.
Click to hide internal directories.