Documentation
¶
Index ¶
- Constants
- Variables
- func NewBuffer() []byte
- type BTree
- func (t *BTree) BeginBulkLoad(opts BulkLoadOptions) (*BulkLoader, error)
- func (t *BTree) Cursor() *Cursor
- func (t *BTree) Delete(key []byte) (PageId, bool, error)
- func (t *BTree) FreeAll() error
- func (t *BTree) Root() PageId
- func (t *BTree) Search(key []byte) ([]byte, error)
- func (t *BTree) Update(key, value []byte, mode Mode) (PageId, error)
- type Bucket
- func (b *Bucket) BeginBulkLoad(opts BulkLoadOptions) (*BulkLoader, error)
- func (b *Bucket) Cursor() *Cursor
- func (b *Bucket) Delete(key []byte) error
- func (b *Bucket) Get(key []byte) ([]byte, error)
- func (b *Bucket) Insert(key, value []byte) error
- func (b *Bucket) Put(key, value []byte) error
- func (b *Bucket) Update(key, value []byte) error
- type BufferPool
- func (bp *BufferPool) AllocatePage(pageId PageId) (*Page, error)
- func (bp *BufferPool) Close() error
- func (bp *BufferPool) FlushAll() error
- func (bp *BufferPool) FlushPage(pageId PageId) error
- func (bp *BufferPool) FlushPages(pageIds []PageId) error
- func (bp *BufferPool) Get(pageId PageId) (*Page, error)
- func (bp *BufferPool) GetForWrite(pageId PageId) (*Page, error)
- func (bp *BufferPool) MarkClean(pageId PageId)
- func (bp *BufferPool) Sync() error
- type BulkLoadOptions
- type BulkLoader
- type Cursor
- func (c *Cursor) Close()
- func (c *Cursor) First() ([]byte, []byte)
- func (c *Cursor) Key() []byte
- func (c *Cursor) Last() ([]byte, []byte)
- func (c *Cursor) Next() ([]byte, []byte)
- func (c *Cursor) Prev() ([]byte, []byte)
- func (c *Cursor) Seek(target []byte) ([]byte, []byte)
- func (c *Cursor) Valid() bool
- func (c *Cursor) Value() ([]byte, error)
- type DB
- type Meta
- type Mode
- type Options
- type Page
- type PageId
- type PageTable
- type StorageManager
- func (s *StorageManager) Allocate(pageId PageId) error
- func (s *StorageManager) Close() error
- func (s *StorageManager) ReadPage(pageId PageId, buf []byte) error
- func (s *StorageManager) Sync() error
- func (s *StorageManager) WritePage(pageId PageId, buf []byte) error
- func (s *StorageManager) WritePagesContiguous(startPageID PageId, bufs [][]byte) error
- type Txn
- func (t *Txn) Abort()
- func (t *Txn) AllocatePage() (*Page, error)
- func (t *Txn) Bucket(name []byte) (*Bucket, error)
- func (t *Txn) CatalogRoot() PageId
- func (t *Txn) Commit() error
- func (t *Txn) CreateBucket(name []byte) (*Bucket, error)
- func (t *Txn) DropBucket(name []byte) error
- func (t *Txn) FreePage(id PageId)
- func (t *Txn) Get(id PageId) (*Page, error)
- func (t *Txn) SetCatalogRoot(id PageId) error
- type TxnID
Constants ¶
View Source
const AlignSize = 4096
View Source
const (
PageSize = 4096
)
Variables ¶
View Source
var ( ErrBucketNotFound = errors.New("frostfire: bucket not found") ErrBucketExists = errors.New("frostfire: bucket already exists") )
View Source
var ( ErrBufferExhausted = errors.New("BufferPool: no unpinned buffers available") ErrInvalidWrite = errors.New("BufferPool: cannot write over pinned or evicting page") )
View Source
var ( ErrBTreeNotEmpty = errors.New("frostfire: bulk load requires an empty btree") ErrBulkLoaderFinished = errors.New("frostfire: bulk loader already finished") ErrBulkLoaderKeyOrder = errors.New("frostfire: bulk loader keys must be strictly increasing") )
View Source
var ( ErrTxnReadOnly = errors.New("frostfire: write operation on read-only transaction") ErrTxnClosed = errors.New("frostfire: transaction already closed") )
View Source
var ( ErrKeyExists = errors.New("frostfire: key already exists") ErrKeyNotFound = errors.New("frostfire: key not found") ErrKeyTooBig = errors.New("frostfire: key exceeds max size") )
View Source
var (
ErrInvalidFileSize = errors.New("file size not a multiple of page size")
)
View Source
var (
ErrMetaCorrupt = errors.New("frostfire: meta pages corrupt")
)
Functions ¶
Types ¶
type BTree ¶
type BTree struct {
// contains filtered or unexported fields
}
func (*BTree) BeginBulkLoad ¶
func (t *BTree) BeginBulkLoad(opts BulkLoadOptions) (*BulkLoader, error)
type Bucket ¶
type Bucket struct {
// contains filtered or unexported fields
}
func (*Bucket) BeginBulkLoad ¶
func (b *Bucket) BeginBulkLoad(opts BulkLoadOptions) (*BulkLoader, error)
type BufferPool ¶
type BufferPool struct {
// contains filtered or unexported fields
}
func NewBufferPool ¶
func NewBufferPool(sm *StorageManager, size int) *BufferPool
func (*BufferPool) AllocatePage ¶
func (bp *BufferPool) AllocatePage(pageId PageId) (*Page, error)
func (*BufferPool) Close ¶
func (bp *BufferPool) Close() error
func (*BufferPool) FlushAll ¶
func (bp *BufferPool) FlushAll() error
func (*BufferPool) FlushPage ¶
func (bp *BufferPool) FlushPage(pageId PageId) error
func (*BufferPool) FlushPages ¶
func (bp *BufferPool) FlushPages(pageIds []PageId) error
func (*BufferPool) GetForWrite ¶
func (bp *BufferPool) GetForWrite(pageId PageId) (*Page, error)
func (*BufferPool) MarkClean ¶
func (bp *BufferPool) MarkClean(pageId PageId)
func (*BufferPool) Sync ¶
func (bp *BufferPool) Sync() error
type BulkLoadOptions ¶
type BulkLoadOptions struct {
FillFactor float64
}
type BulkLoader ¶
type BulkLoader struct {
// contains filtered or unexported fields
}
func (*BulkLoader) Abort ¶
func (l *BulkLoader) Abort()
func (*BulkLoader) Append ¶
func (l *BulkLoader) Append(key, value []byte) error
func (*BulkLoader) Finish ¶
func (l *BulkLoader) Finish() (PageId, error)
type Cursor ¶
type Cursor struct {
// contains filtered or unexported fields
}
type Options ¶
type Options struct {
BufferSize int // number of frames in the buffer pool; defaults to 1024 (4 MB at 4KB pages)
}
type StorageManager ¶
type StorageManager struct {
// contains filtered or unexported fields
}
func NewStorageManager ¶
func NewStorageManager(path string) (*StorageManager, bool, error)
func (*StorageManager) Allocate ¶
func (s *StorageManager) Allocate(pageId PageId) error
func (*StorageManager) Close ¶
func (s *StorageManager) Close() error
func (*StorageManager) ReadPage ¶
func (s *StorageManager) ReadPage(pageId PageId, buf []byte) error
func (*StorageManager) Sync ¶
func (s *StorageManager) Sync() error
func (*StorageManager) WritePage ¶
func (s *StorageManager) WritePage(pageId PageId, buf []byte) error
func (*StorageManager) WritePagesContiguous ¶
func (s *StorageManager) WritePagesContiguous(startPageID PageId, bufs [][]byte) error
type Txn ¶
type Txn struct {
// contains filtered or unexported fields
}
func (*Txn) AllocatePage ¶
func (*Txn) CatalogRoot ¶
func (*Txn) DropBucket ¶
func (*Txn) SetCatalogRoot ¶
Click to show internal directories.
Click to hide internal directories.