Remove some nonsense
parent
3fa82ad29e
commit
60c98e519e
|
@ -948,8 +948,6 @@ func (self *HttpServer) listServers(w libhttp.ResponseWriter, r *libhttp.Request
|
|||
"protobufConnectString": s.ProtobufConnectionString,
|
||||
"isUp": s.IsUp(), //FIXME: IsUp is not consistent
|
||||
"raftName": s.RaftName,
|
||||
"state": s.State,
|
||||
"stateName": s.GetStateName(),
|
||||
"raftConnectionString": s.RaftConnectionString,
|
||||
"leaderRaftName": leaderRaftName,
|
||||
"leaderRaftConnectString": leaderRaftConnectString,
|
||||
|
|
|
@ -285,7 +285,6 @@ func (self *ClusterConfiguration) RemoveServer(server *ClusterServer) error {
|
|||
func (self *ClusterConfiguration) AddPotentialServer(server *ClusterServer) {
|
||||
self.serversLock.Lock()
|
||||
defer self.serversLock.Unlock()
|
||||
server.State = Potential
|
||||
self.servers = append(self.servers, server)
|
||||
self.lastServerIdUsed++
|
||||
server.Id = self.lastServerIdUsed
|
||||
|
|
|
@ -18,7 +18,6 @@ const (
|
|||
type ClusterServer struct {
|
||||
Id uint32
|
||||
RaftName string
|
||||
State ServerState
|
||||
RaftConnectionString string
|
||||
ProtobufConnectionString string
|
||||
connection ServerConnection
|
||||
|
@ -39,32 +38,6 @@ type ServerConnection interface {
|
|||
CancelRequest(*protocol.Request)
|
||||
}
|
||||
|
||||
type ServerState int
|
||||
|
||||
const (
|
||||
LoadingRingData ServerState = iota
|
||||
SendingRingData
|
||||
DeletingOldData
|
||||
Running
|
||||
Potential
|
||||
)
|
||||
|
||||
func (self *ClusterServer) GetStateName() (stateName string) {
|
||||
switch {
|
||||
case self.State == LoadingRingData:
|
||||
return "LoadingRingData"
|
||||
case self.State == SendingRingData:
|
||||
return "SendingRingData"
|
||||
case self.State == DeletingOldData:
|
||||
return "DeletingOldData"
|
||||
case self.State == Running:
|
||||
return "Running"
|
||||
case self.State == Potential:
|
||||
return "Potential"
|
||||
}
|
||||
return "UNKNOWN"
|
||||
}
|
||||
|
||||
func NewClusterServer(raftName, raftConnectionString, protobufConnectionString string, connection ServerConnection, config *c.Configuration) *ClusterServer {
|
||||
|
||||
s := &ClusterServer{
|
||||
|
|
Loading…
Reference in New Issue