Documentation ¶
Index ¶
- Constants
- func GetRandomName() string
- func GetServerIP() string
- func WriteConfiguration(path string, conf *ServerConf)
- type Checker
- type InnerServer
- func (srv *InnerServer) Do()
- func (srv *InnerServer) ExecuteCommand(rpccmd command.RpcCommand, reply *int) (err error)
- func (srv *InnerServer) GetTopology(name *string, reply *cluster.ClusterTopology) (err error)
- func (srv *InnerServer) Ping(name *string, reply *int) (err error)
- func (srv *InnerServer) RegisterNode(node *cluster.ClusterTopologyNode, reply *cluster.ClusterTopology) (err error)
- func (srv *InnerServer) RegisterStepbrother(node *cluster.ClusterTopologyNode, reply *cluster.ClusterTopology) (err error)
- func (srv *InnerServer) RegisterTwin(node *cluster.ClusterTopologyNode, reply *cluster.ClusterTopology) (err error)
- func (srv *InnerServer) RegisterTwinAndStepbrother(node *cluster.ClusterTopologyNode, reply *cluster.ClusterTopology) (err error)
- func (srv *InnerServer) UpdateNode(node *cluster.ClusterTopologyNode, reply *cluster.ClusterTopology) (err error)
- func (srv *InnerServer) UpdateTopology(topology *cluster.ClusterTopology, reply *cluster.ClusterTopology) (err error)
- type Server
- type ServerConf
Constants ¶
View Source
const ( CheckerPeriod = 5 // 5 secs ErrorThreshold = 3 )
View Source
const (
DefaultConfPath string = "./conf/severconf.json"
)
Variables ¶
This section is empty.
Functions ¶
func GetRandomName ¶
func GetRandomName() string
func GetServerIP ¶
func GetServerIP() string
func WriteConfiguration ¶
func WriteConfiguration(path string, conf *ServerConf)
Types ¶
type Checker ¶
type Checker struct {
// contains filtered or unexported fields
}
func NewChecker ¶
func NewChecker(cnf *ServerConf, outcomingQueue *processor.OutCommandQueue, partitioner *processor.Partitioner) *Checker
type InnerServer ¶
type InnerServer struct {
// contains filtered or unexported fields
}
The innser server implementation. Listen for incoming commands.
func NewInnerServer ¶
func NewInnerServer(conf *ServerConf, ks storage.OvoStorage, in *processor.InCommandQueue, out *processor.OutCommandQueue, partitioner *processor.Partitioner) *InnerServer
Creata a new inner server.
func (*InnerServer) ExecuteCommand ¶
func (srv *InnerServer) ExecuteCommand(rpccmd command.RpcCommand, reply *int) (err error)
Enqueue a remote command.
func (*InnerServer) GetTopology ¶
func (srv *InnerServer) GetTopology(name *string, reply *cluster.ClusterTopology) (err error)
Get the topology
func (*InnerServer) RegisterNode ¶
func (srv *InnerServer) RegisterNode(node *cluster.ClusterTopologyNode, reply *cluster.ClusterTopology) (err error)
Register a new node in the cluster.
func (*InnerServer) RegisterStepbrother ¶
func (srv *InnerServer) RegisterStepbrother(node *cluster.ClusterTopologyNode, reply *cluster.ClusterTopology) (err error)
Register the new node as a stepbrother.
func (*InnerServer) RegisterTwin ¶
func (srv *InnerServer) RegisterTwin(node *cluster.ClusterTopologyNode, reply *cluster.ClusterTopology) (err error)
Register the new node as a twin.
func (*InnerServer) RegisterTwinAndStepbrother ¶
func (srv *InnerServer) RegisterTwinAndStepbrother(node *cluster.ClusterTopologyNode, reply *cluster.ClusterTopology) (err error)
Register the new node as a twin and a stepbrother.
func (*InnerServer) UpdateNode ¶
func (srv *InnerServer) UpdateNode(node *cluster.ClusterTopologyNode, reply *cluster.ClusterTopology) (err error)
Update the node state without moving data.
func (*InnerServer) UpdateTopology ¶
func (srv *InnerServer) UpdateTopology(topology *cluster.ClusterTopology, reply *cluster.ClusterTopology) (err error)
Merge the cluster topology configuration.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func NewServer ¶
func NewServer(conf *ServerConf, ks storage.OvoStorage) *Server
type ServerConf ¶
type ServerConf struct { ServerNode *cluster.ClusterTopologyNode Topology cluster.ClusterTopology Debug bool HttpBindAll bool TcpBindAll bool // contains filtered or unexported fields }
func LoadConfiguration ¶
func LoadConfiguration(path string) ServerConf
func (*ServerConf) Init ¶
func (cnf *ServerConf) Init(tmpPath string)
func (*ServerConf) WriteTmp ¶
func (cnf *ServerConf) WriteTmp()
Click to show internal directories.
Click to hide internal directories.