Documentation ¶
Index ¶
Constants ¶
View Source
const SectionalNeedleIdLimit = 1<<32 - 1
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BtreeMap ¶
type BtreeMap struct {
// contains filtered or unexported fields
}
This map assumes mostly inserting increasing keys
func NewBtreeMap ¶
func NewBtreeMap() *BtreeMap
func (*BtreeMap) AscendingVisit ¶
func (cm *BtreeMap) AscendingVisit(visit func(NeedleValue) error) (ret error)
Visit visits all entries or stop if any error when visiting
func (*BtreeMap) Get ¶
func (cm *BtreeMap) Get(key NeedleId) (*NeedleValue, bool)
type CompactMap ¶
type CompactMap struct {
// contains filtered or unexported fields
}
This map assumes mostly inserting increasing keys This map assumes mostly inserting increasing keys
func NewCompactMap ¶
func NewCompactMap() *CompactMap
func (*CompactMap) AscendingVisit ¶
func (cm *CompactMap) AscendingVisit(visit func(NeedleValue) error) error
Visit visits all entries or stop if any error when visiting
func (*CompactMap) Delete ¶
func (cm *CompactMap) Delete(key NeedleId) uint32
func (*CompactMap) Get ¶
func (cm *CompactMap) Get(key NeedleId) (*NeedleValue, bool)
func (*CompactMap) Set ¶
func (cm *CompactMap) Set(key NeedleId, offset Offset, size uint32) (oldOffset Offset, oldSize uint32)
type CompactSection ¶
func NewCompactSection ¶
func NewCompactSection(start NeedleId) *CompactSection
func (*CompactSection) Delete ¶
func (cs *CompactSection) Delete(key NeedleId) uint32
return old entry size
func (*CompactSection) Get ¶
func (cs *CompactSection) Get(key NeedleId) (*NeedleValue, bool)
func (*CompactSection) Set ¶
func (cs *CompactSection) Set(key NeedleId, offset Offset, size uint32) (oldOffset Offset, oldSize uint32)
return old entry size
type NeedleValue ¶
type NeedleValue struct { Key NeedleId Offset Offset `comment:"Volume offset"` //since aligned to 8 bytes, range is 4G*8=32G Size uint32 `comment:"Size of the data portion"` }
func (NeedleValue) ToBytes ¶
func (nv NeedleValue) ToBytes() []byte
type NeedleValueMap ¶
type NeedleValueMap interface { Set(key NeedleId, offset Offset, size uint32) (oldOffset Offset, oldSize uint32) Delete(key NeedleId) uint32 Get(key NeedleId) (*NeedleValue, bool) AscendingVisit(visit func(NeedleValue) error) error }
type Overflow ¶
type Overflow []SectionalNeedleValue
type OverflowExtra ¶
type OverflowExtra []SectionalNeedleValueExtra
type SectionalNeedleId ¶
type SectionalNeedleId uint32
type SectionalNeedleValue ¶
type SectionalNeedleValue struct { Key SectionalNeedleId OffsetLower OffsetLower `comment:"Volume offset"` //since aligned to 8 bytes, range is 4G*8=32G Size uint32 `comment:"Size of the data portion"` }
type SectionalNeedleValueExtra ¶
type SectionalNeedleValueExtra struct {
OffsetHigher OffsetHigher
}
Click to show internal directories.
Click to hide internal directories.