move code around for better readability
This commit is contained in:
parent
31497f4bd3
commit
4a71c68e06
@ -263,19 +263,6 @@ func (s *SplitStore) Get(cid cid.Cid) (blocks.Block, error) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// internal version used by walk so that we don't blow the txn
|
|
||||||
func (s *SplitStore) get(cid cid.Cid) (blocks.Block, error) {
|
|
||||||
blk, err := s.hot.Get(cid)
|
|
||||||
|
|
||||||
switch err {
|
|
||||||
case bstore.ErrNotFound:
|
|
||||||
return s.cold.Get(cid)
|
|
||||||
|
|
||||||
default:
|
|
||||||
return blk, err
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (s *SplitStore) GetSize(cid cid.Cid) (int, error) {
|
func (s *SplitStore) GetSize(cid cid.Cid) (int, error) {
|
||||||
s.txnLk.RLock()
|
s.txnLk.RLock()
|
||||||
defer s.txnLk.RUnlock()
|
defer s.txnLk.RUnlock()
|
||||||
@ -1087,6 +1074,19 @@ func (s *SplitStore) walkLinks(c cid.Cid, walked *cid.Set, f func(cid.Cid) error
|
|||||||
return rerr
|
return rerr
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// internal version used by walk so that we don't blow the txn
|
||||||
|
func (s *SplitStore) get(cid cid.Cid) (blocks.Block, error) {
|
||||||
|
blk, err := s.hot.Get(cid)
|
||||||
|
|
||||||
|
switch err {
|
||||||
|
case bstore.ErrNotFound:
|
||||||
|
return s.cold.Get(cid)
|
||||||
|
|
||||||
|
default:
|
||||||
|
return blk, err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func (s *SplitStore) moveColdBlocks(cold []cid.Cid) error {
|
func (s *SplitStore) moveColdBlocks(cold []cid.Cid) error {
|
||||||
batch := make([]blocks.Block, 0, batchSize)
|
batch := make([]blocks.Block, 0, batchSize)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user