package
25.1.0+incompatible
Repository: https://github.com/cockroachdb/cockroach.git
Documentation: pkg.go.dev
# Functions
DecodeRaftAdmissionMeta decodes admission control metadata from a raftpb.Entry.Data.
DecomposeRaftEncodingStandardOrSideloaded extracts the CmdIDKey and the marshaled kvserverpb.RaftCommand from a raftpb.Entry slice known to have Entry with type EntryEncoding{Standard,Sideloaded}With{,out}AC.
EncodeCommand encodes the provided command into a slice.
EncodeCommandBytes encodes a marshaled kvserverpb.RaftCommand using the given encoding (one of EntryEncoding{Standard,Sideloaded}With{,out}AC{AndPriority}).
EncodeRaftCommandPrefix encodes the prefix for a Raft command, using the given encoding (one of EntryEncoding{Standard,Sideloaded}With{,out}AC{AndPriority}).
EncodingOf determines the EntryEncoding for a given Entry.
MakeCmdIDKey populates a random CmdIDKey.
NewEntry populates an Entry from the provided raftpb.Entry.
NewEntryFromRawValue populates an Entry from a raw value, i.e.
NewIterator initializes an Iterator that reads the raft log for the given RangeID from the provided Reader.
Visit invokes fn with the raft log entries whose indexes fall into [lo, hi) in ascending index order.
# Constants
EntryEncodingEmpty is an empty entry.
EntryEncodingRaftConfChange is a raftpb.Entry whose raftpb.EntryType is raftpb.EntryConfChange.
EntryEncodingRaftConfChangeV2 is analogous to EntryEncodingRaftConfChange, with the replacements raftpb.EntryConfChange{,V2} and raftpb.ConfChange{,V2} applied.
EntryEncodingSideloadedWithAC indicates a proposal representing the result of a kvpb.AddSSTableRequest for which the payload (the SST) is stored outside the storage engine to improve storage performance, and is encoded for replication admission control v1.
EntryEncodingSideloadedWithACAndPriority is analogous to EntryEncodingSideloadedWithAC, but additionally has the most significant bits in the first byte containing the raftpb.Priority.
EntryEncodingSideloadedWithoutAC is like EntryEncodingStandardWithoutAC but without below-raft admission metadata.
EntryEncodingStandardWithAC is the encoding for a CockroachDB raft log entry in replication admission control v1.
EntryEncodingStandardWithACAndPriority is analogous to EntryEncodingStandardWithAC, but additionally has the most significant bits in the first byte containing the raftpb.Priority.
EntryEncodingStandardWithoutAC is like EntryEncodingStandardWithAC but without the metadata for below-raft admission control.
RaftCommandIDLen is the length of a command ID.
RaftCommandPrefixLen is the length of the prefix of raft entries that use the EntryEncoding{Standard,Sideloaded}With{,out}AC encodings.
# Structs
EncodeOptions provides additional information that may be need to be encoded.
Entry contains data related to a raft log entry.
An Iterator inspects the raft log.
IterOptions are options to NewIterator.
ReplicatedCmd is the part of kvserver.replicatedCmd relevant for stand-alone log application, i.e.
# Interfaces
Reader is the subset of storage.Reader relevant for accessing the raft log.
# Type aliases
EntryEncoding enumerates the encodings used in CockroachDB for raftpb.Entry's Data slice.