Documentation ¶
Index ¶
- Variables
- func CpuUsages() ([]float64, error)
- func DescribeReplica(shardID uint64, peerID uint64) string
- func DiskStats(path string) (*disk.UsageStat, error)
- func FirstError(err1 error, err2 error) error
- func GZIP(fs vfs.FS, path string) error
- func GetTestDir() string
- func IORates(path string) (map[string]disk.IOCountersStat, error)
- func IsDarwin() bool
- func MemStats() (*mem.VirtualMemoryStat, error)
- func RAMDiskDirExist(dir string) bool
- func UnGZIP(fs vfs.FS, file string, dest string) error
- type KVTree
- func (kv *KVTree) Delete(key []byte) bool
- func (kv *KVTree) Get(key []byte) []byte
- func (kv *KVTree) PrefixScan(prefix []byte, handler func(key, value []byte) (bool, error)) error
- func (kv *KVTree) Put(key, value []byte)
- func (kv *KVTree) RangeDelete(start, end []byte)
- func (kv *KVTree) Scan(start, end []byte, handler func(key, value []byte) (bool, error)) error
- func (kv *KVTree) Seek(key []byte) ([]byte, []byte)
- type ShardItem
- type ShardTree
- func (t *ShardTree) Ascend(fn func(Shard *meta.Shard) bool)
- func (t *ShardTree) AscendRange(start, end []byte, fn func(Shard *meta.Shard) bool)
- func (t *ShardTree) NextShard(start []byte) *meta.Shard
- func (t *ShardTree) Remove(shard meta.Shard) bool
- func (t *ShardTree) Search(key []byte) meta.Shard
- func (t *ShardTree) Update(shards ...meta.Shard)
- type WriteBatch
Constants ¶
This section is empty.
Variables ¶
View Source
var (
DefaultTimeoutWheel = putil.DefaultTimeoutWheel
)
Functions ¶
func DescribeReplica ¶ added in v0.2.0
DescribeReplica returns a string representation of a replica ID used in logging.
func FirstError ¶ added in v0.2.0
FirstError returns the first error.
func MemStats ¶
func MemStats() (*mem.VirtualMemoryStat, error)
MemStats returns the mem usage stats
func RAMDiskDirExist ¶
RAMDiskDirExist returns whether the specified directory is a mounted RAM disk,
Types ¶
type KVTree ¶
KVTree kv btree
func (*KVTree) PrefixScan ¶
PrefixScan Scan scans all keys startswith pre
func (*KVTree) RangeDelete ¶
RangeDelete deletes key in [start, end)
type ShardItem ¶
ShardItem is the Shard btree item
type ShardTree ¶
ShardTree is the btree for Shard
func (*ShardTree) AscendRange ¶
AscendRange asc iterator the tree in the range [start, end) until fn returns false
func (*ShardTree) Remove ¶
Remove removes a Shard if the Shard is in the tree. It will do nothing if it cannot find the Shard or the found Shard is not the same with the Shard.
type WriteBatch ¶
type WriteBatch interface { // Set set kv-value to the batch Set([]byte, []byte) // Delete add delete key to the batch Delete([]byte) // DeleteRange deletes the keys specified in the range DeleteRange([]byte, []byte) // Reset reset the batch Reset() // Close close the batch Close() }
WriteBatch write batch
Source Files ¶
Click to show internal directories.
Click to hide internal directories.