util

package
v0.0.0-...-735feb9 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2019 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BytesToUint64

func BytesToUint64(b []byte) uint64

converts bytes to an unsinged 64 bit integer

func GetGID

func GetGID() uint64

func IsSyncMapEmpty

func IsSyncMapEmpty(m *sync.Map) bool

func LenSyncMap

func LenSyncMap(m *sync.Map) int

func NewConnectionCache

func NewConnectionCache(cip ClusterInfoProvider) *connCache

func NowUnixUtc

func NowUnixUtc() uint64

func OutboundIP

func OutboundIP() net.IP

get preferred outbound ip of this machine

func RandomRaftId

func RandomRaftId() uint64

func TrackTime

func TrackTime(logger *log.Entry, name string, start time.Time)

func Uint64ToBytes

func Uint64ToBytes(u uint64) []byte

converts a uint64 to a byte slice

func Uint64ToBytesInto

func Uint64ToBytesInto(u uint64, buf []byte) error

func Uint64ToString

func Uint64ToString(i uint64) string

Types

type ClusterInfoProvider

type ClusterInfoProvider interface {
	FindOwnerForKey(key []byte) uint64
	FindPartitionForKey(key []byte) int
	IsLocal(key []byte) bool
	AmIWriter(writerNodes []uint64) bool
	GetAddressFor(nodeID uint64) string
	MyPartitions() []int
	FindOwnerForPartition(partitionID int) uint64
}

func NewClusterInfoProvider

func NewClusterInfoProvider(ownNodeID uint64, pathToClusterInfo string) ClusterInfoProvider

type ConnectionCache

type ConnectionCache interface {
	GetLowIsolationReadClient(nodeID uint64) (pb.LowIsolationReadClient, error)
	GetRemoteReadClient(nodeID uint64) (pb.RemoteReadClient, error)
	GetRaftTransportClient(nodeID uint64) (pb.RaftTransportClient, error)
	Close()
}

type DataStoreTxn

type DataStoreTxn interface {
	Get(key []byte) []byte
	Set(key []byte, value []byte) error
	Commit() error
	Rollback() error
}

type DataStoreTxnProvider

type DataStoreTxnProvider interface {
	StartTxn(writable bool) (DataStoreTxn, error)
	Snapshot(w io.Writer) error
	Close()
	Delete()
}

type PartitionedDataStore

type PartitionedDataStore interface {
	CreatePartition(partitionID int) (DataStoreTxnProvider, error)
	GetPartition(partitionID int) (DataStoreTxnProvider, error)
	Snapshot(w io.Writer) error
	Close()
}

Jump to

Keyboard shortcuts

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