From 60c98e519e4b4a77896146a7ab300f3fd830c2e7 Mon Sep 17 00:00:00 2001 From: John Shahid Date: Thu, 30 Oct 2014 14:16:15 -0400 Subject: [PATCH] Remove some nonsense --- api/http/api.go | 2 -- cluster/cluster_configuration.go | 1 - cluster/cluster_server.go | 27 --------------------------- 3 files changed, 30 deletions(-) diff --git a/api/http/api.go b/api/http/api.go index 021714188a..5f4eaea01d 100644 --- a/api/http/api.go +++ b/api/http/api.go @@ -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, diff --git a/cluster/cluster_configuration.go b/cluster/cluster_configuration.go index f4258c3e0b..c2bd0f7fb8 100644 --- a/cluster/cluster_configuration.go +++ b/cluster/cluster_configuration.go @@ -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 diff --git a/cluster/cluster_server.go b/cluster/cluster_server.go index b75c48006d..70b676b563 100644 --- a/cluster/cluster_server.go +++ b/cluster/cluster_server.go @@ -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{