Browse Source

Merge pull request #1325 from jonboulle/store_cleaner_still

store: remove unused code
Jonathan Boulle 11 years ago
parent
commit
aed525edee
4 changed files with 1 additions and 31 deletions
  1. 1 2
      etcdserver/server_test.go
  2. 0 11
      store/command_factory.go
  3. 0 13
      store/stats.go
  4. 0 5
      store/store.go

+ 1 - 2
etcdserver/server_test.go

@@ -1131,8 +1131,7 @@ func (s *storeRecorder) Recovery(b []byte) error {
 	s.record(action{name: "Recovery"})
 	return nil
 }
-func (s *storeRecorder) TotalTransactions() uint64 { return 0 }
-func (s *storeRecorder) JsonStats() []byte         { return nil }
+func (s *storeRecorder) JsonStats() []byte { return nil }
 func (s *storeRecorder) DeleteExpiredKeys(cutoff time.Time) {
 	s.record(action{
 		name:   "DeleteExpiredKeys",

+ 0 - 11
store/command_factory.go

@@ -1,11 +0,0 @@
-package store
-
-// MinVersion returns the minimum compatible store version.
-func MinVersion() int {
-	return 2
-}
-
-// MaxVersion returns the maximum compatible store version.
-func MaxVersion() int {
-	return 2
-}

+ 0 - 13
store/stats.go

@@ -86,24 +86,11 @@ func (s *Stats) clone() *Stats {
 		s.CompareAndDeleteSuccess, s.CompareAndDeleteFail, s.Watchers, s.ExpireCount}
 }
 
-// Status() return the statistics info of etcd storage its recent start
 func (s *Stats) toJson() []byte {
 	b, _ := json.Marshal(s)
 	return b
 }
 
-func (s *Stats) TotalReads() uint64 {
-	return s.GetSuccess + s.GetFail
-}
-
-func (s *Stats) TotalTranscations() uint64 {
-	return s.SetSuccess + s.SetFail +
-		s.DeleteSuccess + s.DeleteFail +
-		s.CompareAndSwapSuccess + s.CompareAndSwapFail +
-		s.CompareAndDeleteSuccess + s.CompareAndDeleteFail +
-		s.UpdateSuccess + s.UpdateFail
-}
-
 func (s *Stats) Inc(field int) {
 	switch field {
 	case SetSuccess:

+ 0 - 5
store/store.go

@@ -56,7 +56,6 @@ type Store interface {
 	Save() ([]byte, error)
 	Recovery(state []byte) error
 
-	TotalTransactions() uint64
 	JsonStats() []byte
 	DeleteExpiredKeys(cutoff time.Time)
 }
@@ -656,7 +655,3 @@ func (s *store) JsonStats() []byte {
 	s.Stats.Watchers = uint64(s.WatcherHub.count)
 	return s.Stats.toJson()
 }
-
-func (s *store) TotalTransactions() uint64 {
-	return s.Stats.TotalTranscations()
-}