Documentation ¶
Index ¶
Constants ¶
View Source
const ( BPTreePageType = 1 // 叶子页 BPTreePageTypeIndex = 2 // 索引页 )
Variables ¶
View Source
var (
NotFoundError = errors.New("NotFound")
)
Functions ¶
func NewConsistent ¶
NewConsistent 创建一致性hash算法结构体,设置默认节点数量
Types ¶
type BPTree ¶
type BPTree struct { Order int RootPage *BPTreePage LeafPage *BPTreePage }
type BPTreeNode ¶
type BPTreeNode struct { Index int Data interface{} Next *BPTreeNode Page *BPTreePage ChildPage *BPTreePage }
type BPTreePage ¶
type BPTreePage struct { Type int Pre, Next *BPTreePage ParentNode *BPTreeNode HeadNode *BPTreeNode Len int Cap int }
func (*BPTreePage) DeleteByIndex ¶
func (page *BPTreePage) DeleteByIndex(index int) *BPTreeNode
func (*BPTreePage) Insert ¶
func (page *BPTreePage) Insert(node *BPTreeNode)
func (*BPTreePage) Split ¶
func (page *BPTreePage) Split() (*BPTreePage, *BPTreePage)
func (*BPTreePage) Up ¶
func (page *BPTreePage) Up()
Click to show internal directories.
Click to hide internal directories.