kvstore

package
v0.0.0-...-382cb39 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2017 License: Apache-2.0 Imports: 4 Imported by: 0

README

docstore builds on top of kvstore

Documentation

Index

Constants

View Source
const PartitionsCount = ZonesCount * PartitionsPerZone
View Source
const PartitionsPerZone = 997
View Source
const ZonesCount = 32

Variables

View Source
var Append = func(ctx context.Context, partition uint64, namespace string, key uint64, rowValue []byte) error {
	return errors.New("not implemented")
}
View Source
var Get = func(ctx context.Context, partition uint64, namespace string, key uint64) ([]byte, error) {
	return nil, errors.New("not implemented")
}
View Source
var GetMetadata = func(ctx context.Context, key string) ([]byte, error) {
	return nil, errors.New("not implemented")
}
View Source
var GetMonotonic = func(ctx context.Context, partition uint64, namespace string, key string) (uint64, error) {
	return 0, errors.New("not implemented")
}
View Source
var KeyConflictError = errors.New("key conflict")
View Source
var Scan = func(ctx context.Context, partition uint64, namespace string, fromKey uint64) (RowIterator, error) {
	return nil, errors.New("not implemented")
}
View Source
var ScanMetadata = func(ctx context.Context, fromKey string, toKey string) (MetadataRowIterator, error) {
	return nil, errors.New("not implemented")
}

[fromKey, toKey] ordered lexically

View Source
var SetMetadata = func(ctx context.Context, key string, value []byte) error {
	return errors.New("not implemented")
}
View Source
var SetMonotonic = func(ctx context.Context, partition uint64, namespace string, key string, value uint64) error {
	return errors.New("not implemented")
}

Functions

func HashToPartition

func HashToPartition(entityId string) uint64

func NewID

func NewID(zoneId int) string

id is 21 bytes zoneId should be within [0, 31] if one entity type has many entities, we can assign multiple zone to expand capacity if many entity types only has small number of entities, we can compact them in same zone

Types

type MetadataRow

type MetadataRow struct {
	Key   string
	Value []byte
}

type MetadataRowIterator

type MetadataRowIterator func() ([]MetadataRow, error)

type Row

type Row struct {
	Key   uint64
	Value []byte
}

type RowIterator

type RowIterator func() ([]Row, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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