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:
parent
5fa1c993b9
commit
5ca18837e9
7
db.go
7
db.go
|
@ -520,6 +520,13 @@ func validateBlockSequence(bs []DiskBlock) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (db *DB) Blocks() []DiskBlock {
|
||||||
|
db.mtx.RLock()
|
||||||
|
defer db.mtx.RUnlock()
|
||||||
|
|
||||||
|
return db.blocks
|
||||||
|
}
|
||||||
|
|
||||||
// Close the partition.
|
// Close the partition.
|
||||||
func (db *DB) Close() error {
|
func (db *DB) Close() error {
|
||||||
close(db.stopc)
|
close(db.stopc)
|
||||||
|
|
Loading…
Reference in New Issue