bucket

package
v0.0.0-...-2c8b24f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 24, 2015 License: GPL-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const HEADER_SIZE = 18
View Source
const MAX_BYTES_STORE_SIZE = 255 - 2
View Source
const (
	OVERFLOW = 1 << iota
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockTable

type BlockTable struct {
	// contains filtered or unexported fields
}

func NewBlockTable

func NewBlockTable(file file.BlockDevice, keysize, valsize uint8) (*BlockTable, error)

func ReadBlockTable

func ReadBlockTable(file file.BlockDevice, key int64) (self *BlockTable, err error)

func (*BlockTable) Get

func (self *BlockTable) Get(key bs.ByteSlice) (value bs.ByteSlice, err error)

func (*BlockTable) Has

func (self *BlockTable) Has(key bs.ByteSlice) bool

func (*BlockTable) Key

func (self *BlockTable) Key() int64

func (*BlockTable) Put

func (self *BlockTable) Put(key, value bs.ByteSlice) (err error)

func (*BlockTable) RecordsPerBlock

func (self *BlockTable) RecordsPerBlock() int

func (*BlockTable) Remove

func (self *BlockTable) Remove(key bs.ByteSlice) (err error)

type BytesStore

type BytesStore struct {
	// contains filtered or unexported fields
}

func NewBytesStore

func NewBytesStore(keysize, valsize uint8) (*BytesStore, error)

func (*BytesStore) Get

func (self *BytesStore) Get(bytes bs.ByteSlice) (key, value bs.ByteSlice, err error)

func (*BytesStore) Put

func (self *BytesStore) Put(key, value bs.ByteSlice) (bytes bs.ByteSlice, err error)

func (*BytesStore) Remove

func (self *BytesStore) Remove(bytes bs.ByteSlice) (err error)

func (*BytesStore) Size

func (self *BytesStore) Size() uint8

func (*BytesStore) Update

func (self *BytesStore) Update(bytes, key, value bs.ByteSlice) (rbytes bs.ByteSlice, err error)

type HashBucket

type HashBucket struct {
	// contains filtered or unexported fields
}

func NewHashBucket

func NewHashBucket(file file.BlockDevice, hashsize uint8, kv KVStore) (self *HashBucket, err error)

func ReadHashBucket

func ReadHashBucket(file file.BlockDevice, key int64, kv KVStore) (self *HashBucket, err error)

func (*HashBucket) Get

func (self *HashBucket) Get(hash, key bs.ByteSlice) (value bs.ByteSlice, err error)

func (*HashBucket) Has

func (self *HashBucket) Has(hash, key bs.ByteSlice) bool

func (*HashBucket) Key

func (self *HashBucket) Key() int64

func (*HashBucket) Keys

func (self *HashBucket) Keys() (keys []bs.ByteSlice)

func (*HashBucket) PrintBucket

func (self *HashBucket) PrintBucket()

func (*HashBucket) Put

func (self *HashBucket) Put(hash, key, value bs.ByteSlice) (updated bool, err error)

func (*HashBucket) Remove

func (self *HashBucket) Remove(hash, key bs.ByteSlice) (err error)

func (*HashBucket) Split

func (self *HashBucket) Split(stay func(key bs.ByteSlice) bool) (other *HashBucket, err error)

type KVStore

type KVStore interface {
	Size() uint8
	Get(bytes bs.ByteSlice) (key, value bs.ByteSlice, err error)
	Put(key, value bs.ByteSlice) (bytes bs.ByteSlice, err error)
	Update(bytes, key, value bs.ByteSlice) (rbytes bs.ByteSlice, err error)
	Remove(bytes bs.ByteSlice) (err error)
}

type VarcharStore

type VarcharStore struct {
	// contains filtered or unexported fields
}

func NewVarcharStore

func NewVarcharStore(file file.BlockDevice) (*VarcharStore, error)

func (*VarcharStore) Get

func (self *VarcharStore) Get(bytes bs.ByteSlice) (key, value bs.ByteSlice, err error)

func (*VarcharStore) Put

func (self *VarcharStore) Put(key, value bs.ByteSlice) (bytes bs.ByteSlice, err error)

func (*VarcharStore) Remove

func (self *VarcharStore) Remove(bytes bs.ByteSlice) (err error)

func (*VarcharStore) Size

func (self *VarcharStore) Size() uint8

func (*VarcharStore) Update

func (self *VarcharStore) Update(bytes, key, value bs.ByteSlice) (rbytes bs.ByteSlice, err error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL