Make DB blocks list public.

This enable computing the first timestamp in the DB
only accessing public interfaces.

Signed-off-by: Thibault Chataigner <t.chataigner@criteo.com>
This commit is contained in:
Thibault Chataigner 2017-08-29 15:39:27 +02:00
parent 5fa1c993b9
commit 5ca18837e9
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)