Documentation ¶
Index ¶
- Constants
- Variables
- func BytesToInt32(n []byte) (int32, error)
- func BytesToInt64(n []byte) (int64, error)
- func BytesToUint16(n []byte) (uint16, error)
- func BytesToUint32(n []byte) (uint32, error)
- func BytesToUint64(n []byte) (uint64, error)
- func DefaultTimeoutWheel() *goetty.TimeoutWheel
- func DiskStats(path string) (*disk.UsageStat, error)
- func GZIP(path string) error
- func InitMetric(runner *task.Runner, cfg *MetricCfg)
- func Int64ToBytes(n int64) ([]byte, error)
- func Int64ToStrBytes(n int64) ([]byte, error)
- func IsNumber(s string) bool
- func NoConvert(key []byte, do func([]byte) metapb.Cell) metapb.Cell
- func ParseUrls(s string) ([]url.URL, error)
- func PrintVersion() bool
- func RawDBPrefix(tenantId string, dbId uint8) []byte
- func RawKeyPrefix(tenantid string, dbid uint8, key []byte) []byte
- func RawSysGCPointKey() []byte
- func RawSysLeaderKey() []byte
- func RawTenantPrefix(tenantId string) []byte
- func ReverseByteMetrics(a [][]byte)
- func StrBytesToInt64(n []byte) (int64, error)
- func StrBytesToUint64(n []byte) (uint64, error)
- func StrToInt64(n string) (int64, error)
- func StrToUint64(n string) (uint64, error)
- func Uint16ToBytes(n uint16) ([]byte, error)
- func Uint16ToBytes1(dst []byte, n uint16) error
- func Uint32ToBytes(n uint32) ([]byte, error)
- func Uint32ToBytes1(dst []byte, n uint32) error
- func Uint64Convert(key []byte, do func([]byte) metapb.Cell) metapb.Cell
- func Uint64ToBytes(n uint64) ([]byte, error)
- func Uint64ToBytes1(dst []byte, n uint64) error
- func UnGZIP(file string, dest string) error
- func ZScoreDecoder(rawkeyPrefixLen int, rawkey []byte) (int64, []byte, error)
- func ZScoreOffset(score int64) uint64
- func ZScoreRestore(rscore uint64) int64
- type CellItem
- type CellTree
- func (t *CellTree) Ascend(fn func(cell *metapb.Cell) bool)
- func (t *CellTree) AscendRange(start, end []byte, fn func(cell *metapb.Cell) bool)
- func (t *CellTree) NextCell(start []byte) *metapb.Cell
- func (t *CellTree) Remove(cell metapb.Cell) bool
- func (t *CellTree) Search(key []byte) metapb.Cell
- func (t *CellTree) Update(cell metapb.Cell)
- type CharType
- type KVTree
- func (kv *KVTree) Delete(key []byte) bool
- func (kv *KVTree) Get(key []byte) []byte
- 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 Limiter
- type MetricCfg
- type OffsetQueue
- type State
- type Trie
Constants ¶
const ( // tenant length should be less than 250, 251-255 can be used by system LeaderKey = 251 GCPointKey = 252 )
const ( TSTRING byte = iota TLISTMETA TLISTDATA THASHMETA THASHDATA TSETMETA TSETDATA TZSETMETA TZSETSCORE TZSETDATA TTTLMETA TTTLDATA )
const ( FNORMAL byte = iota FDELETED )
const ( ObjectData byte = iota ObjectTTL )
const ( MetaTypeKey byte = iota DataTypeKey ScoreTypeKey )
Variables ¶
var ( GitCommit = "" BuildTime = "" GoVersion = "" Version = "" )
set on build time
var (
EmptyListOrSet []interface{} = make([]interface{}, 0)
)
var (
ErrParams = errors.New("params error")
)
number convert utils
Functions ¶
func BytesToInt32 ¶
func BytesToInt64 ¶
func BytesToUint16 ¶
func BytesToUint32 ¶
func BytesToUint64 ¶
func DefaultTimeoutWheel ¶
func DefaultTimeoutWheel() *goetty.TimeoutWheel
DefaultTimeoutWheel returns default timeout wheel
func Int64ToBytes ¶
func Int64ToStrBytes ¶
func RawDBPrefix ¶
func RawKeyPrefix ¶
tenantlen(2)|tenant|dbid(1)|typedata(1)|userkeylen(4)|userkey
func RawSysGCPointKey ¶
func RawSysGCPointKey() []byte
func RawSysLeaderKey ¶
func RawSysLeaderKey() []byte
func RawTenantPrefix ¶
func ReverseByteMetrics ¶
func ReverseByteMetrics(a [][]byte)
func StrBytesToInt64 ¶
func StrBytesToUint64 ¶
func StrToInt64 ¶
func StrToUint64 ¶
func Uint16ToBytes ¶
func Uint16ToBytes1 ¶
func Uint32ToBytes ¶
func Uint32ToBytes1 ¶
func Uint64Convert ¶
Uint64Convert returns the hash crc64 result value, must use `ReleaseConvertBytes` to release
func Uint64ToBytes ¶
func Uint64ToBytes1 ¶
func ZScoreOffset ¶
func ZScoreRestore ¶
Types ¶
type CellItem ¶
type CellItem struct {
// contains filtered or unexported fields
}
CellItem is the cell btree item
type CellTree ¶
CellTree is the btree for cell
func (*CellTree) AscendRange ¶
AscendRange asc iterator the tree in the range [start, end) until fn returns false
func (*CellTree) Remove ¶
Remove removes a cell if the cell is in the tree. It will do nothing if it cannot find the cell or the found cell is not the same with the cell.
type KVTree ¶
KVTree kv btree
func (*KVTree) RangeDelete ¶
RangeDelete deletes key in [start, end)
type Limiter ¶
type Limiter struct {
// contains filtered or unexported fields
}
Limiter limiter implemention by token
type OffsetQueue ¶
OffsetQueue is a queue for sync.
func (*OffsetQueue) Add ¶
func (q *OffsetQueue) Add(item interface{}) uint64
Add add a item to the queue
func (*OffsetQueue) Get ¶
func (q *OffsetQueue) Get(offset uint64) ([]interface{}, uint64)
Get returns all the items after the offset, and remove all items before this offset
func (*OffsetQueue) GetMaxOffset ¶
func (q *OffsetQueue) GetMaxOffset() uint64
GetMaxOffset returns the max offset in the queue