Last active
April 7, 2017 14:39
-
-
Save zelig/3c8507e919fa45d2ba38ddd260c76ea0 to your computer and use it in GitHub Desktop.
dumper
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func (s *DbStore) Dump() { | |
//Iterates over the database and checks that there are no faulty chunks | |
it := s.db.NewIterator() | |
startPosition := []byte{kpIndex} | |
it.Seek(startPosition) | |
var key []byte | |
var total int | |
for it.Valid() { | |
key = it.Key() | |
if (key == nil) || (key[0] != kpIndex) { | |
break | |
} | |
total++ | |
fmt.Printf("%x\n", key[1:]) | |
it.Next() | |
} | |
it.Release() | |
log.Warn(fmt.Sprintf("logged %v chunks", total)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment