Documentation
¶
Index ¶
- Constants
- type HashTableBlockPage
- func (page *HashTableBlockPage) Insert(index uint64, key uint64, value uint64) bool
- func (page *HashTableBlockPage) IsOccupied(index uint64) bool
- func (page *HashTableBlockPage) IsReadable(index uint64) bool
- func (page *HashTableBlockPage) KeyAt(index uint64) uint64
- func (page *HashTableBlockPage) Remove(index uint64)
- func (page *HashTableBlockPage) ValueAt(index uint64) uint64
- type HashTableHeaderPage
- func (page *HashTableHeaderPage) AddBlockPageId(pageId types.PageID)
- func (page *HashTableHeaderPage) GetBlockPageId(index uint64) types.PageID
- func (page *HashTableHeaderPage) GetPageId() types.PageID
- func (page *HashTableHeaderPage) GetSize() int
- func (page *HashTableHeaderPage) NumBlocks() uint64
- func (page *HashTableHeaderPage) SetPageId(pageId types.PageID)
- func (page *HashTableHeaderPage) SetSize(size int)
- type HashTablePair
- type Page
- func (p *Page) AddRLatchRecord(info int32)
- func (p *Page) AddWLatchRecord(info int32)
- func (p *Page) Copy(offset uint32, data []byte)
- func (p *Page) Data() *[common.PageSize]byte
- func (p *Page) DecPinCount()
- func (p *Page) GetData() *[common.PageSize]byte
- func (p *Page) GetLSN() types.LSN
- func (p *Page) GetPageId() types.PageID
- func (p *Page) GetRWLachObj() common.ReaderWriterLatch
- func (p *Page) IncPinCount()
- func (p *Page) IsDeallocated() bool
- func (p *Page) IsDirty() bool
- func (p *Page) PinCount() int32
- func (p *Page) PrintMutexDebugInfo()
- func (p *Page) PrintPinCount()
- func (p *Page) RLatch()
- func (p *Page) RUnlatch()
- func (p *Page) RemoveRLatchRecord(info int32)
- func (p *Page) RemoveWLatchRecord(info int32)
- func (p *Page) SetIsDeallocated(isDeallocated bool)
- func (p *Page) SetIsDirty(isDirty bool)
- func (p *Page) SetLSN(lsn types.LSN)
- func (p *Page) WLatch()
- func (p *Page) WUnlatch()
- type PageIF
- type RID
Constants ¶
View Source
const BlockArraySize = 4 * common.PageSize / (4*sizeOfHashTablePair + 1)
View Source
const OffsetLSN = 4
View Source
const OffsetPageStart = 0
View Source
const SizePageHeader = 8
PageSize is the size of a page in disk (4KB) const PageSize = 4096
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HashTableBlockPage ¶
type HashTableBlockPage struct {
// contains filtered or unexported fields
}
*
- Store indexed key and value together within block page. Supports
- non-unique keys. *
- Block page format (keys are stored in order):
- ----------------------------------------------------------------
- | KEY(1) + VALUE(1) | KEY(2) + VALUE(2) | ... | KEY(n) + VALUE(n)
- ---------------------------------------------------------------- *
- Here '+' means concatenation. *
func (*HashTableBlockPage) Insert ¶
func (page *HashTableBlockPage) Insert(index uint64, key uint64, value uint64) bool
Attempts to insert a key and value into an index in the baccess.
func (*HashTableBlockPage) IsOccupied ¶
func (page *HashTableBlockPage) IsOccupied(index uint64) bool
Returns whether or not an index is occuppied (valid key/value pair)
func (*HashTableBlockPage) IsReadable ¶
func (page *HashTableBlockPage) IsReadable(index uint64) bool
Returns whether or not an index is readable (valid key/value pair)
func (*HashTableBlockPage) KeyAt ¶
func (page *HashTableBlockPage) KeyAt(index uint64) uint64
Gets the key at an index in the block
func (*HashTableBlockPage) Remove ¶
func (page *HashTableBlockPage) Remove(index uint64)
func (*HashTableBlockPage) ValueAt ¶
func (page *HashTableBlockPage) ValueAt(index uint64) uint64
Gets the value at an index in the block
type HashTableHeaderPage ¶
type HashTableHeaderPage struct {
// contains filtered or unexported fields
}
*
* * Header Page for linear probing hash table. * * Header format (size in byte, 12 bytes in total): * ---------------------------------------------------------------------- * | PageId(4) | NextBlockIndex(4) | Size (4) | BlockPageIds (4) x 1020 * ---------------------------------------------------------------------- * all Page content size: 12 + 8 * 1020 = 4096
func (*HashTableHeaderPage) AddBlockPageId ¶
func (page *HashTableHeaderPage) AddBlockPageId(pageId types.PageID)
func (*HashTableHeaderPage) GetBlockPageId ¶
func (page *HashTableHeaderPage) GetBlockPageId(index uint64) types.PageID
func (*HashTableHeaderPage) GetPageId ¶
func (page *HashTableHeaderPage) GetPageId() types.PageID
func (*HashTableHeaderPage) GetSize ¶
func (page *HashTableHeaderPage) GetSize() int
func (*HashTableHeaderPage) NumBlocks ¶
func (page *HashTableHeaderPage) NumBlocks() uint64
func (*HashTableHeaderPage) SetPageId ¶
func (page *HashTableHeaderPage) SetPageId(pageId types.PageID)
func (*HashTableHeaderPage) SetSize ¶
func (page *HashTableHeaderPage) SetSize(size int)
type HashTablePair ¶
type HashTablePair struct {
// contains filtered or unexported fields
}
type Page ¶
type Page struct { // for debug WLatchMap map[int32]bool RLatchMap map[int32]bool RLatchMapMutex *sync.Mutex // contains filtered or unexported fields }
Page represents an abstract page on disk
func (*Page) AddRLatchRecord ¶
func (*Page) GetRWLachObj ¶
func (p *Page) GetRWLachObj() common.ReaderWriterLatch
func (*Page) IsDeallocated ¶
func (*Page) PrintMutexDebugInfo ¶
func (p *Page) PrintMutexDebugInfo()
func (*Page) PrintPinCount ¶
func (p *Page) PrintPinCount()
func (*Page) RemoveRLatchRecord ¶
func (*Page) RemoveWLatchRecord ¶
func (*Page) SetIsDeallocated ¶
type PageIF ¶
type PageIF interface { DecPinCount() IncPinCount() }
currently used for SkipList only
Source Files
¶
Click to show internal directories.
Click to hide internal directories.