You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
478 B

  1. package needle
  2. import (
  3. "strconv"
  4. "github.com/google/btree"
  5. )
  6. const (
  7. batch = 100000
  8. )
  9. type NeedleValue struct {
  10. Key Key
  11. Offset uint32 `comment:"Volume offset"` //since aligned to 8 bytes, range is 4G*8=32G
  12. Size uint32 `comment:"Size of the data portion"`
  13. }
  14. func (this NeedleValue) Less(than btree.Item) bool {
  15. that := than.(NeedleValue)
  16. return this.Key < that.Key
  17. }
  18. type Key uint64
  19. func (k Key) String() string {
  20. return strconv.FormatUint(uint64(k), 10)
  21. }