Documentation
¶
Overview ¶
Package loncha/list_head is like a kernel's LIST_HEAD list_head is used by loncha/gen/containers_list
Package skitlistmap ... concurrent akiplist map implementatin Copyright 2201 Kazuhisa TAKEI<xtakei@rytr.jp>. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
Package skitlistmap ... concurrent akiplist map implementatin Copyright 2201 Kazuhisa TAKEI<xtakei@rytr.jp>. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
Index ¶
- Constants
- Variables
- func KeyToHash(key interface{}) (uint64, uint64)
- func Log(l LogLevel, s string, args ...interface{})
- func MemHash(data []byte) uint64
- func MemHashString(str string) uint64
- func NewEntryMap(key, value interface{}) *entryHMap
- func ResetStats()
- func SetLogIO(w io.Writer)
- func WithBucket(b *bucket) func(*hmapMethod)
- type CondOfFinder
- type HMapEntry
- type HMethodOpt
- type LevelHead
- type LogLevel
- type Map
- func (h *Map) Delete(key interface{})
- func (h *Map) DumpBucket() string
- func (h *Map) DumpBucketPerLevel() string
- func (h *Map) DumpEntry() string
- func (h *Map) Get(key interface{}) (value interface{}, ok bool)
- func (h *Map) GetWithFn(key interface{}, onSuccess func(interface{})) bool
- func (h *Map) LoadItem(key interface{}) (MapItem, bool)
- func (h *Map) MakeBucket(ocur *list_head.ListHead, back int)
- func (h *Map) Options(opts ...OptHMap) (previouses []OptHMap)
- func (h *Map) Range(f func(key, value interface{}) bool)
- func (h *Map) RangeItem(f func(MapItem) bool)
- func (h *Map) SearchKey(k uint64, opts ...searchArg) HMapEntry
- func (h *Map) Set(key, value interface{}) bool
- func (h *Map) StoreItem(item MapItem) bool
- type MapHead
- func (mh *MapHead) ConflictInHamp() uint64
- func (c *MapHead) FromListHead(l *list_head.ListHead) list_head.List
- func (mh *MapHead) KeyInHmap() uint64
- func (c *MapHead) NextWithNil() *MapHead
- func (mh *MapHead) Offset() uintptr
- func (c *MapHead) PrevtWithNil() *MapHead
- func (mh *MapHead) PtrListHead() *list_head.ListHead
- type MapItem
- type OptHMap
- type SampleItem
- func (s *SampleItem) Delete()
- func (s *SampleItem) HmapEntryFromListHead(lhead *list_head.ListHead) HMapEntry
- func (s *SampleItem) Key() interface{}
- func (s *SampleItem) Next() HMapEntry
- func (s *SampleItem) Offset() uintptr
- func (s *SampleItem) Prev() HMapEntry
- func (s *SampleItem) PtrMapHead() *MapHead
- func (s *SampleItem) PtrMapeHead() *MapHead
- func (s *SampleItem) SetValue(v interface{}) bool
- func (s *SampleItem) Value() interface{}
- type SearchMode
Constants ¶
const ( CntSearchBucket statKey = 1 CntLevelBucket statKey = 2 CntSearchEntry statKey = 3 CntReverseSearch statKey = 4 CntOfGet statKey = 5 )
Variables ¶
var DebugStats map[statKey]int = map[statKey]int{}
var (
EmptyEntryHMap *entryHMap = emptyEntryHMap
)
var EnableStats bool = false
var Failreverse uint64 = 0
Functions ¶
func MemHashString ¶
func NewEntryMap ¶
func NewEntryMap(key, value interface{}) *entryHMap
func ResetStats ¶ added in v0.1.3
func ResetStats()
func WithBucket ¶
func WithBucket(b *bucket) func(*hmapMethod)
Types ¶
type CondOfFinder ¶
type CondOfFinder func(ehead *entryHMap) bool
func CondOfFind ¶
func CondOfFind(reverse uint64, l sync.Locker) CondOfFinder
type HMethodOpt ¶
type HMethodOpt func(*hmapMethod)
type Map ¶
type Map struct {
ItemFn func() MapItem
// contains filtered or unexported fields
}
Map ... Skip List Map is an ordered and concurrent map. this Map is gourtine safety for reading/updating/deleting, require locking and coordination. This
func (*Map) Delete ¶
func (h *Map) Delete(key interface{})
Delete ... set nil to the key of MapItem. cannot Get entry
func (*Map) DumpBucket ¶
func (*Map) DumpBucketPerLevel ¶
func (*Map) LoadItem ¶
LoadItem ... return key/value item with embedded-linked-list. if not found, ok is false
func (*Map) Range ¶ added in v0.1.2
Range ... calls f sequentially for each key and value present in the map. order is reverse key order
type MapHead ¶
func (*MapHead) ConflictInHamp ¶
func (*MapHead) NextWithNil ¶ added in v0.1.3
func (*MapHead) PrevtWithNil ¶ added in v0.1.3
func (*MapHead) PtrListHead ¶
type SampleItem ¶
type SampleItem struct {
K interface{}
V interface{}
MapHead
}
var EmptySampleHMapEntry SampleItem = SampleItem{}
func SampleItemFromListHead ¶
func SampleItemFromListHead(head *list_head.ListHead) *SampleItem
func (*SampleItem) Delete ¶
func (s *SampleItem) Delete()
func (*SampleItem) HmapEntryFromListHead ¶
func (s *SampleItem) HmapEntryFromListHead(lhead *list_head.ListHead) HMapEntry
func (*SampleItem) Key ¶
func (s *SampleItem) Key() interface{}
func (*SampleItem) Next ¶
func (s *SampleItem) Next() HMapEntry
func (*SampleItem) Offset ¶
func (s *SampleItem) Offset() uintptr
func (*SampleItem) Prev ¶
func (s *SampleItem) Prev() HMapEntry
func (*SampleItem) PtrMapHead ¶
func (s *SampleItem) PtrMapHead() *MapHead
func (*SampleItem) PtrMapeHead ¶
func (s *SampleItem) PtrMapeHead() *MapHead
func (*SampleItem) SetValue ¶
func (s *SampleItem) SetValue(v interface{}) bool
func (*SampleItem) Value ¶
func (s *SampleItem) Value() interface{}
type SearchMode ¶
type SearchMode byte
const ( LenearSearchForBucket SearchMode = iota NestedSearchForBucket CombineSearch CombineSearch2 NoItemSearchForBucket = 9 // test mode FalsesSearchForBucket = 10 )