key

package
v2.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2016 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func KeyRangeContains

func KeyRangeContains(kr *topodatapb.KeyRange, id []byte) bool

KeyRangeContains returns true if the provided id is in the keyrange.

func KeyRangeEndEqual

func KeyRangeEndEqual(left, right *topodatapb.KeyRange) bool

KeyRangeEndEqual returns true if both key ranges have the same end

func KeyRangeEqual

func KeyRangeEqual(left, right *topodatapb.KeyRange) bool

KeyRangeEqual returns true if both key ranges cover the same area

func KeyRangeIsPartial

func KeyRangeIsPartial(kr *topodatapb.KeyRange) bool

KeyRangeIsPartial returns true if the KeyRange does not cover the entire space.

func KeyRangeStartEqual

func KeyRangeStartEqual(left, right *topodatapb.KeyRange) bool

KeyRangeStartEqual returns true if both key ranges have the same start

func KeyRangeString

func KeyRangeString(k *topodatapb.KeyRange) string

KeyRangeString prints a topodatapb.KeyRange

func KeyRangesIntersect

func KeyRangesIntersect(first, second *topodatapb.KeyRange) bool

KeyRangesIntersect returns true if some Keyspace values exist in both ranges.

func KeyRangesOverlap

func KeyRangesOverlap(first, second *topodatapb.KeyRange) (*topodatapb.KeyRange, error)

KeyRangesOverlap returns the overlap between two KeyRanges. They need to overlap, otherwise an error is returned.

func ParseKeyRangeParts

func ParseKeyRangeParts(start, end string) (*topodatapb.KeyRange, error)

ParseKeyRangeParts parses a start and end hex values and build a proto KeyRange

func ParseKeyspaceIDType

func ParseKeyspaceIDType(param string) (topodatapb.KeyspaceIdType, error)

ParseKeyspaceIDType parses the keyspace id type into the enum

func ParseShardingSpec

func ParseShardingSpec(spec string) ([]*topodatapb.KeyRange, error)

ParseShardingSpec parses a string that describes a sharding specification. a-b-c-d will be parsed as a-b, b-c, c-d. The empty string may serve both as the start and end of the keyspace: -a-b- will be parsed as start-a, a-b, b-end.

Types

type Uint64Key

type Uint64Key uint64

Uint64Key is a uint64 that can be converted into a KeyspaceId.

func (Uint64Key) Bytes

func (i Uint64Key) Bytes() []byte

Bytes returns the keyspace id (as bytes) associated with a Uint64Key.

func (Uint64Key) String

func (i Uint64Key) String() string

Jump to

Keyboard shortcuts

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