2017-05-27 05:51:25 +00:00
|
|
|
package needle
|
|
|
|
|
|
|
|
import (
|
2018-07-08 09:28:04 +00:00
|
|
|
. "github.com/chrislusf/seaweedfs/weed/storage/types"
|
2018-07-22 00:39:10 +00:00
|
|
|
"github.com/google/btree"
|
2017-05-27 05:51:25 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
const (
|
|
|
|
batch = 100000
|
|
|
|
)
|
|
|
|
|
|
|
|
type NeedleValue struct {
|
2018-07-08 09:28:04 +00:00
|
|
|
Key NeedleId
|
|
|
|
Offset Offset `comment:"Volume offset"` //since aligned to 8 bytes, range is 4G*8=32G
|
2017-05-27 05:51:25 +00:00
|
|
|
Size uint32 `comment:"Size of the data portion"`
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this NeedleValue) Less(than btree.Item) bool {
|
|
|
|
that := than.(NeedleValue)
|
|
|
|
return this.Key < that.Key
|
|
|
|
}
|