Merge pull request #134 from criteo-forks/master

Expose `Blocks()` on DB
This commit is contained in:
Goutham Veeramachaneni 2017-09-25 17:41:25 +05:30 committed by GitHub
commit 87c01dd5fb
1 changed files with 7 additions and 0 deletions

7
db.go
View File

@ -520,6 +520,13 @@ func validateBlockSequence(bs []DiskBlock) error {
return nil
}
func (db *DB) Blocks() []DiskBlock {
db.mtx.RLock()
defer db.mtx.RUnlock()
return db.blocks
}
// Close the partition.
func (db *DB) Close() error {
close(db.stopc)