Documentation ¶
Index ¶
- Constants
- func ToBytes(key NeedleId, offset Offset, size Size) []byte
- type CompactMap
- type CompactSection
- type MemDb
- func (cm *MemDb) AscendingVisit(visit func(NeedleValue) error) (ret error)
- func (cm *MemDb) Close()
- func (cm *MemDb) Delete(key NeedleId) error
- func (cm *MemDb) Get(key NeedleId) (*NeedleValue, bool)
- func (cm *MemDb) LoadFromIdx(idxName string) (ret error)
- func (cm *MemDb) LoadFromReaderAt(readerAt io.ReaderAt) (ret error)
- func (cm *MemDb) SaveToIdx(idxName string) (ret error)
- func (cm *MemDb) Set(key NeedleId, offset Offset, size Size) error
- type NeedleValue
- type NeedleValueMap
- type Overflow
- type OverflowExtra
- type SectionalNeedleId
- type SectionalNeedleValue
- type SectionalNeedleValueExtra
Constants ¶
View Source
const SectionalNeedleIdLimit = 1<<32 - 1
Variables ¶
This section is empty.
Functions ¶
Types ¶
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) Size
func (*CompactMap) Get ¶
func (cm *CompactMap) Get(key NeedleId) (*NeedleValue, bool)
func (*CompactMap) Set ¶
func (cm *CompactMap) Set(key NeedleId, offset Offset, size Size) (oldOffset Offset, oldSize Size)
type CompactSection ¶
func NewCompactSection ¶
func NewCompactSection(start NeedleId) *CompactSection
func (*CompactSection) Delete ¶
func (cs *CompactSection) Delete(key NeedleId) Size
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 Size) (oldOffset Offset, oldSize Size)
return old entry size
type MemDb ¶
type MemDb struct {
// contains filtered or unexported fields
}
This map uses in memory level db
func (*MemDb) AscendingVisit ¶
func (cm *MemDb) AscendingVisit(visit func(NeedleValue) error) (ret error)
Visit visits all entries or stop if any error when visiting
func (*MemDb) Get ¶
func (cm *MemDb) Get(key NeedleId) (*NeedleValue, bool)
func (*MemDb) LoadFromIdx ¶
func (*MemDb) LoadFromReaderAt ¶
type NeedleValue ¶
type NeedleValue struct { Key NeedleId Offset Offset `comment:"Volume offset"` //since aligned to 8 bytes, range is 4G*8=32G Size Size `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 Size) (oldOffset Offset, oldSize Size) Delete(key NeedleId) Size 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 Size `comment:"Size of the data portion"` }
type SectionalNeedleValueExtra ¶
type SectionalNeedleValueExtra struct {
OffsetHigher OffsetHigher
}
Click to show internal directories.
Click to hide internal directories.