Documentation ¶
Overview ¶
Package art implements the Adaptive Radix Tree, and use Optimistic Locking method to achieve thread safe concurrent operation. The ART is described in "V. Leis, A. Kemper, and T. Neumann. The adaptive radix tree: ARTful indexing for main-memory databases. In ICDE, 2013". The Optimistic Syncing is described in "V. Leis, et al., The ART of Practical Synchronization, in DaMoN, 2016".
Index ¶
- type ART
- func (t *ART) Delete(key []byte)
- func (t *ART) Get(key []byte) (interface{}, bool)
- func (t *ART) Max() ([]byte, interface{})
- func (t *ART) Min() ([]byte, interface{})
- func (t *ART) Prefix(prefix []byte, f OpFunc)
- func (t *ART) Put(key []byte, value interface{})
- func (t *ART) Range(begin, end []byte, includeBegin, includeEnd bool, f OpFunc)
- func (t *ART) RangeTop(k int, begin, end []byte, includeBegin, includeEnd bool, f OpFunc)
- type OpFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ART ¶
type ART struct {
// contains filtered or unexported fields
}
ART implements the Adaptive Radix Tree with Optimistic Locking. It looks like a KV data structure, which use byte slice as key. It support thread safe concurrent update and query.
func (*ART) Delete ¶
Delete delete the given key and it's value from this tree. This operation is thread safe.
func (*ART) Get ¶
Get lookup this tree, and return the value associate with the given key. This operation is thread safe.
func (*ART) Max ¶
Max return the maximal key and it's value in this tree. This operation is thread safe.
func (*ART) Min ¶
Min return the minimal key and it's value in this tree. This operation is thread safe.
func (*ART) Prefix ¶
Prefix find all key have the given prefix in this tree. This operation is thread safe.
func (*ART) Put ¶
Put put the given key and value into this tree, or replace exist key's value. This operation is thread safe.