camp

package module
v0.0.0-...-b5e5c3c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 22, 2020 License: MIT Imports: 5 Imported by: 0

README

concurrentMap

介绍

一个基于go开发的并发安全的数据字典,Tps单机可达100000

软件架构

软件架构说明

安装教程
  1. xxxx
  2. xxxx
  3. xxxx
使用说明
  1. xxxx
  2. xxxx
  3. xxxx
参与贡献
  1. Fork 本仓库
  2. 新建 Feat_xxx 分支
  3. 提交代码
  4. 新建 Pull Request
码云特技
  1. 使用 Readme_XXX.md 来支持不同的语言,例如 Readme_en.md, Readme_zh.md
  2. 码云官方博客 blog.gitee.com
  3. 你可以 https://gitee.com/explore 这个地址来了解码云上的优秀开源项目
  4. GVP 全称是码云最有价值开源项目,是码云综合评定出的优秀开源项目
  5. 码云官方提供的使用手册 https://gitee.com/help
  6. 码云封面人物是一档用来展示码云会员风采的栏目 https://gitee.com/gitee-stars/

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bucket

type Bucket interface {
	Put(pair Pair) (bool, error)
	Get(key string) Pair
	Delete(key string) bool
	Clear()
	GetFirstPair() Pair
	Size() uint64
}

func NewBucket

func NewBucket() Bucket

type BucketStatus

type BucketStatus uint8
const (
	BUCKET_STATUS_UNDERWEIGHT BucketStatus = 1
	BUCKET_STATUS_OVERWEIGHT  BucketStatus = 2
)

type Cmap

type Cmap interface {
	Put(key string, element interface{}) (bool, error)
	Get(key string) interface{}
	Delete(key string) bool
	Concurrent() uint32
	Total() uint64
}

func NewCamp

func NewCamp(concrrent uint32) (Cmap, error)

type Pair

type Pair interface {
	Key() string
	Hash() uint64
	SetElement(element interface{}) error
	Element() interface{}
	Copy() Pair
	// contains filtered or unexported methods
}

func New

func New(key string, element interface{}) (Pair, error)

type Segment

type Segment interface {
	Put(pair Pair) (bool, error)
	Get(key string) Pair
	Total() uint64
	BucketNum() uint32
	Delete(key string) bool
}

func NewSegment

func NewSegment(factor float64, bucketMax uint64) Segment

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL