Documentation ¶
Index ¶
- Variables
- type BlockingKMapContainer
- func (bm *BlockingKMapContainer) Del(key MapKey, value interface{})
- func (bm *BlockingKMapContainer) Get(key MapKey) (interface{}, error)
- func (bm *BlockingKMapContainer) Len() int
- func (bm *BlockingKMapContainer) LoadBase(iterator DataIterator) error
- func (bm *BlockingKMapContainer) LoadInc(iterator DataIterator) error
- func (bm *BlockingKMapContainer) Range(f func(key, value interface{}) bool)
- func (bm *BlockingKMapContainer) Set(key MapKey, value interface{}) error
- type BlockingMapContainer
- func (bm *BlockingMapContainer) Del(key MapKey, value interface{})
- func (bm *BlockingMapContainer) Get(key MapKey) (interface{}, error)
- func (bm *BlockingMapContainer) Len() int
- func (bm *BlockingMapContainer) LoadBase(iterator DataIterator) error
- func (bm *BlockingMapContainer) LoadInc(iterator DataIterator) error
- func (bm *BlockingMapContainer) Range(f func(key, value interface{}) bool)
- func (bm *BlockingMapContainer) Set(key MapKey, value interface{}) error
- type BufferedKListContainer
- func (bm *BufferedKListContainer) Del(key MapKey, value interface{})
- func (bm *BufferedKListContainer) Get(key MapKey) (interface{}, error)
- func (bm *BufferedKListContainer) LoadBase(iterator DataIterator) error
- func (bm *BufferedKListContainer) LoadInc(iterator DataIterator) error
- func (bm *BufferedKListContainer) Set(key MapKey, value interface{}) error
- type BufferedMapContainer
- func (bm *BufferedMapContainer) Del(key MapKey, value interface{})
- func (bm *BufferedMapContainer) Get(key MapKey) (interface{}, error)
- func (bm *BufferedMapContainer) Len() int
- func (bm *BufferedMapContainer) LoadBase(iterator DataIterator) error
- func (bm *BufferedMapContainer) LoadInc(iterator DataIterator) error
- func (bm *BufferedMapContainer) Range(f func(key, value interface{}) bool)
- func (bm *BufferedMapContainer) Set(key MapKey, value interface{}) error
- type ConcurrentSliceMap
- func (m *ConcurrentSliceMap) Delete(key interface{})
- func (m *ConcurrentSliceMap) Len() int
- func (m *ConcurrentSliceMap) Load(key interface{}) (interface{}, bool)
- func (m *ConcurrentSliceMap) Range(f func(key, value interface{}) bool)
- func (m *ConcurrentSliceMap) Store(key interface{}, v interface{})
- type ConcurrentSliceMap2
- func (m *ConcurrentSliceMap2) Delete(key interface{})
- func (m *ConcurrentSliceMap2) Len() int
- func (m *ConcurrentSliceMap2) Load(key interface{}) (interface{}, bool)
- func (m *ConcurrentSliceMap2) Range(f func(key, value interface{}) bool)
- func (m *ConcurrentSliceMap2) Store(key interface{}, v interface{})
- type Container
- type DataIterator
- type DataMode
- type Int64Key
- type MapKey
- type StringKey
Constants ¶
This section is empty.
Variables ¶
View Source
var NotExistErr = errors.New("not exist")
View Source
var NotPartition = errors.New("not partition")
Functions ¶
This section is empty.
Types ¶
type BlockingKMapContainer ¶
type BlockingKMapContainer struct { Tolerate float64 // contains filtered or unexported fields }
多线程读写安全的container,支持增量
func CreateBlockingKSetContainer ¶
func CreateBlockingKSetContainer(tolerate float64) *BlockingKMapContainer
func (*BlockingKMapContainer) Del ¶
func (bm *BlockingKMapContainer) Del(key MapKey, value interface{})
func (*BlockingKMapContainer) Get ¶
func (bm *BlockingKMapContainer) Get(key MapKey) (interface{}, error)
func (*BlockingKMapContainer) Len ¶
func (bm *BlockingKMapContainer) Len() int
func (*BlockingKMapContainer) LoadBase ¶
func (bm *BlockingKMapContainer) LoadBase(iterator DataIterator) error
func (*BlockingKMapContainer) LoadInc ¶
func (bm *BlockingKMapContainer) LoadInc(iterator DataIterator) error
func (*BlockingKMapContainer) Range ¶
func (bm *BlockingKMapContainer) Range(f func(key, value interface{}) bool)
func (*BlockingKMapContainer) Set ¶
func (bm *BlockingKMapContainer) Set(key MapKey, value interface{}) error
type BlockingMapContainer ¶
type BlockingMapContainer struct { InnerData *ConcurrentSliceMap2 Tolerate float64 // contains filtered or unexported fields }
多线程读写安全的container,支持增量
func CreateBlockingMapContainer ¶
func CreateBlockingMapContainer(numPartision int, tolerate float64) *BlockingMapContainer
func (*BlockingMapContainer) Del ¶
func (bm *BlockingMapContainer) Del(key MapKey, value interface{})
func (*BlockingMapContainer) Get ¶
func (bm *BlockingMapContainer) Get(key MapKey) (interface{}, error)
func (*BlockingMapContainer) Len ¶
func (bm *BlockingMapContainer) Len() int
func (*BlockingMapContainer) LoadBase ¶
func (bm *BlockingMapContainer) LoadBase(iterator DataIterator) error
func (*BlockingMapContainer) LoadInc ¶
func (bm *BlockingMapContainer) LoadInc(iterator DataIterator) error
func (*BlockingMapContainer) Range ¶
func (bm *BlockingMapContainer) Range(f func(key, value interface{}) bool)
func (*BlockingMapContainer) Set ¶
func (bm *BlockingMapContainer) Set(key MapKey, value interface{}) error
type BufferedKListContainer ¶
type BufferedKListContainer struct { ErrorNum int // contains filtered or unexported fields }
双bufMap, 仅提供Get/LoadBase接口
func CreateBufferedKListContainer ¶
func CreateBufferedKListContainer() *BufferedKListContainer
func (*BufferedKListContainer) Del ¶
func (bm *BufferedKListContainer) Del(key MapKey, value interface{})
func (*BufferedKListContainer) Get ¶
func (bm *BufferedKListContainer) Get(key MapKey) (interface{}, error)
func (*BufferedKListContainer) LoadBase ¶
func (bm *BufferedKListContainer) LoadBase(iterator DataIterator) error
func (*BufferedKListContainer) LoadInc ¶
func (bm *BufferedKListContainer) LoadInc(iterator DataIterator) error
func (*BufferedKListContainer) Set ¶
func (bm *BufferedKListContainer) Set(key MapKey, value interface{}) error
type BufferedMapContainer ¶
type BufferedMapContainer struct { Tolerate float64 // contains filtered or unexported fields }
双bufMap, 仅提供Get/LoadBase接口
func (*BufferedMapContainer) Del ¶
func (bm *BufferedMapContainer) Del(key MapKey, value interface{})
func (*BufferedMapContainer) Get ¶
func (bm *BufferedMapContainer) Get(key MapKey) (interface{}, error)
func (*BufferedMapContainer) Len ¶
func (bm *BufferedMapContainer) Len() int
func (*BufferedMapContainer) LoadBase ¶
func (bm *BufferedMapContainer) LoadBase(iterator DataIterator) error
func (*BufferedMapContainer) LoadInc ¶
func (bm *BufferedMapContainer) LoadInc(iterator DataIterator) error
func (*BufferedMapContainer) Range ¶
func (bm *BufferedMapContainer) Range(f func(key, value interface{}) bool)
func (*BufferedMapContainer) Set ¶
func (bm *BufferedMapContainer) Set(key MapKey, value interface{}) error
type ConcurrentSliceMap ¶ added in v0.3.1
type ConcurrentSliceMap struct {
// contains filtered or unexported fields
}
func CreateConcurrentSliceMap ¶ added in v0.3.1
func CreateConcurrentSliceMap(lenOfBucket int) *ConcurrentSliceMap
CreateConcurrentSliceMap is to create a ConcurrentSliceMap with the setting number of the partitions & len of the Buckets NumOfPartitions will auto add capacity
func (*ConcurrentSliceMap) Delete ¶ added in v0.3.1
func (m *ConcurrentSliceMap) Delete(key interface{})
func (*ConcurrentSliceMap) Len ¶ added in v0.3.1
func (m *ConcurrentSliceMap) Len() int
func (*ConcurrentSliceMap) Load ¶ added in v0.3.1
func (m *ConcurrentSliceMap) Load(key interface{}) (interface{}, bool)
func (*ConcurrentSliceMap) Range ¶ added in v0.3.1
func (m *ConcurrentSliceMap) Range(f func(key, value interface{}) bool)
func (*ConcurrentSliceMap) Store ¶ added in v0.3.1
func (m *ConcurrentSliceMap) Store(key interface{}, v interface{})
type ConcurrentSliceMap2 ¶ added in v0.3.2
type ConcurrentSliceMap2 struct {
// contains filtered or unexported fields
}
func CreateConcurrentSliceMap2 ¶ added in v0.3.2
func CreateConcurrentSliceMap2(lenOfBucket int) *ConcurrentSliceMap2
CreateConcurrentSliceMap2 is to create a ConcurrentSliceMap2 with the setting number of the partitions & len of the Buckets NumOfPartitions will auto add capacity
func (*ConcurrentSliceMap2) Delete ¶ added in v0.3.2
func (m *ConcurrentSliceMap2) Delete(key interface{})
func (*ConcurrentSliceMap2) Len ¶ added in v0.3.2
func (m *ConcurrentSliceMap2) Len() int
func (*ConcurrentSliceMap2) Load ¶ added in v0.3.2
func (m *ConcurrentSliceMap2) Load(key interface{}) (interface{}, bool)
func (*ConcurrentSliceMap2) Range ¶ added in v0.3.2
func (m *ConcurrentSliceMap2) Range(f func(key, value interface{}) bool)
func (*ConcurrentSliceMap2) Store ¶ added in v0.3.2
func (m *ConcurrentSliceMap2) Store(key interface{}, v interface{})
type DataIterator ¶
type MapKey ¶
type MapKey interface { PartitionKey() int64 Value() interface{} }
key of the map, because of go-lang not support generic type, So, here defined an interface for int Data or string Data key
type StringKey ¶
type StringKey struct {
Data string
}
StringKey is for the string type key
func (*StringKey) PartitionKey ¶
PartitionID is created by string's hash
Click to show internal directories.
Click to hide internal directories.