Remove some nonsense

pull/1081/merge
John Shahid 2014-10-30 14:16:15 -04:00
parent 3fa82ad29e
commit 60c98e519e
3 changed files with 0 additions and 30 deletions

View File

@ -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,

View File

@ -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

View File

@ -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{