keys

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// DataPrefixSize data prefix size
	DataPrefixSize = dataPrefixKeySize + 8
)

data is in (z, z+1)

View Source
var (
	// we use this fixed key to write a dummy record into the KVStore with sync=true
	// to force a sync of the WAL of the KVStore.
	ForcedSyncKey = []byte{0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}
)

Functions

func GetAppliedIndexKey

func GetAppliedIndexKey(shardID uint64, key []byte) []byte

GetAppliedIndexKey returns key that used to store `applied log index` for `storage.DataStorage`

func GetHardStateKey

func GetHardStateKey(shardID uint64, replicaID uint64, key []byte) []byte

GetHardStateKey returns key that used to store `raftpb.HardState`

func GetMaxIndexKey

func GetMaxIndexKey(shardID uint64, key []byte) []byte

GetMaxIndexKey returns key that used to max applied log index

func GetMetadataIndex

func GetMetadataIndex(key []byte) (uint64, error)

func GetMetadataKey

func GetMetadataKey(shardID uint64, index uint64, key []byte) []byte

GetMetadataKey returns key that used to store `shard metadata` for `storage.DataStorage`

func GetRaftLogIndex

func GetRaftLogIndex(key []byte) (uint64, error)

func GetRaftLogKey

func GetRaftLogKey(shardID uint64, index uint64, key []byte) []byte

GetRaftLogKey returns key that used to store `raftpb.Entry`

func GetRaftPrefix

func GetRaftPrefix(shardID uint64) []byte

func GetShardIDFromAppliedIndexKey

func GetShardIDFromAppliedIndexKey(key []byte) (uint64, error)

GetShardIDFromAppliedIndexKey returns shard id

func GetShardIDFromMetadataKey

func GetShardIDFromMetadataKey(key []byte) (uint64, error)

func GetSnapshotKey

func GetSnapshotKey(shardID uint64, index uint64, key []byte) []byte

GetSnapshotKey returns the key used to store snapshot metadata in LogDB.

func GetStoreIdentKey

func GetStoreIdentKey() []byte

GetStoreIdentKey return key of StoreIdent

func IsAppliedIndexKey

func IsAppliedIndexKey(key []byte) bool

func IsMetadataKey

func IsMetadataKey(key []byte) bool

func IsRaftLogKey

func IsRaftLogKey(key []byte) bool

Types

This section is empty.

Jump to

Keyboard shortcuts

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