Documentation
¶
Index ¶
- Constants
- func ExtractAccessBucketFromKey(key []byte) string
- func ExtractSegmentPath(deleteIndexKey []byte) string
- func ExtractUserKey(metadataKey []byte) string
- func GetBucketedAccessKey(timestamp time.Time) string
- func GetFifoIndexPrefix() []byte
- func IsBucketedAccessKey(key []byte) bool
- func IsDeleteIndexKey(key []byte) bool
- func IsDeletionQueueKey(key []byte) bool
- func IsInternalKey(key []byte) bool
- func IsMetadataKey(key []byte) bool
- func IsSyncKey(key []byte) bool
- func MakeBucketedAccessIndexKey(key string) []byte
- func MakeBucketedAccessKey(key string, accessTime time.Time) []byte
- func MakeCompactionKey(ts int64, key string) []byte
- func MakeDeleteIndexKey(segmentPath string) []byte
- func MakeDeletionQueueKey(timestamp int64, filepath string) []byte
- func MakeFifoBackrefKey(key string) []byte
- func MakeFifoIndexKey(key string, writeTime time.Time) []byte
- func MakeMetadataKey(userKey string) []byte
- func MakeSyncKey(filepath string) []byte
- func ParseBucketedAccessKey(bucketedKey []byte) (string, time.Time, error)
- func ParseCompactionIndexRow(k, v []byte) (userKey, filePath string, ok bool)
- func ParseDeletionQueueKey(key []byte) (int64, string, error)
- func ParseFifoIndexKey(fifoKey []byte) (string, error)
- func ParseFifoIndexTime(fifoKey []byte) (time.Time, error)
- func ParseSyncKey(key []byte) (int64, string, error)
Constants ¶
const ( // MetadataPrefix is the prefix for user metadata keys stored in RocksDB. // This ensures user keys have their own namespace separate from internal keys. // Uses the same format as other internal keys (starting with !) MetadataPrefix = "!meta/" // VersionHWMKey stores the durable version-reservation high-water mark for // the CAS stamp source (issue #254): nextVersion never issues a stamp above // the persisted reservation without first extending it durably, so stamps // stay monotonic across restarts even if the wall clock steps backward. // A single internal key; pre-versioning binaries simply never read it. VersionHWMKey = "!verhwm" // AccessBucketPrefix is the prefix for time-bucketed access index entries // Format: !access_bucket/YYYYMMDDHH/timestamp_nano/key AccessBucketPrefix = "!access_bucket/" // AccessBucketFormat is the time format for bucket keys (YYYYMMDDHH) AccessBucketFormat = "2006010215" // AccessBucketIndexPrefix is the prefix for the secondary index mapping keys to their bucket location // Format: !bucket_index/<key> -> bucketed_key AccessBucketIndexPrefix = "!access_bucket_index/" // CompactionIndexPrefix is the prefix for all compaction index entries in RocksDB CompactionIndexPrefix = "!compact/" // CompactionIndexKeyFormat is the format for compaction index keys // Format: !compact/<timestamp>|<userKey> CompactionIndexKeyFormat = "!compact/%020d|%s" // SyncIndexPrefix is the prefix for all sync tracking entries in RocksDB SyncIndexPrefix = "!sync/" // DeletionQueuePrefix is the prefix for deletion queue entries in RocksDB DeletionQueuePrefix = "!del/" // DeleteIndexPrefix is the prefix for segment deletion tracking entries in RocksDB DeleteIndexPrefix = "!delete:segment/" // FifoIndexPrefix is the prefix for the FIFO eviction index. Entries embed the // write time in the key so the eviction scan can walk them oldest-written // first. Unlike the access index, entries are written once at Put and never // bumped on reads. // Format: !fifo/<write_time_nano>/<key> FifoIndexPrefix = "!fifo/" // FifoBackrefPrefix is the prefix for the FIFO secondary index that maps a // cache key to its current FIFO entry, mirroring the LRU access index's // secondary index. It lets Put/Delete/TTL locate and remove a key's previous // FIFO entry so the index holds exactly one entry per live key. // Format: !fifo_ref/<key> -> !fifo/<nano>/<key> FifoBackrefPrefix = "!fifo_ref/" )
Variables ¶
This section is empty.
Functions ¶
func ExtractAccessBucketFromKey ¶
ExtractAccessBucketFromKey extracts just the bucket portion from a full key Returns empty string if not a valid bucketed key
func ExtractSegmentPath ¶
ExtractSegmentPath extracts the segment path from a delete index key
func ExtractUserKey ¶
ExtractUserKey removes the metadata prefix from a metadata key to get the original user key
func GetBucketedAccessKey ¶
GetBucketedAccessKey returns the bucket key for a given timestamp Format: !access_bucket/YYYYMMDDHH/
func GetFifoIndexPrefix ¶ added in v1.8.0
func GetFifoIndexPrefix() []byte
GetFifoIndexPrefix returns the prefix used to iterate FIFO index entries (oldest first, since the write-time nanos sort lexicographically).
func IsBucketedAccessKey ¶
IsBucketedAccessKey checks if a key is a bucketed access index key
func IsDeleteIndexKey ¶
IsDeleteIndexKey checks if a key is a delete index entry
func IsDeletionQueueKey ¶
IsDeletionQueueKey checks if a key is a deletion queue entry
func IsInternalKey ¶
IsInternalKey checks if a given key is an internal system key (starts with !)
func IsMetadataKey ¶
IsMetadataKey checks if a given key is a user metadata key (has the metadata prefix)
func MakeBucketedAccessIndexKey ¶
MakeBucketedAccessIndexKey creates a secondary index key that maps a cache key to its current bucket location Format: !bucket_index/<key>
func MakeBucketedAccessKey ¶
MakeBucketedAccessKey creates a bucketed access index key Format: !access_bucket/YYYYMMDDHH/timestamp_nano/key
func MakeCompactionKey ¶
MakeCompactionKey creates a compaction key by adding the compaction prefix to the user key
func MakeDeleteIndexKey ¶
MakeDeleteIndexKey creates a delete index key for tracking segment deletions
func MakeDeletionQueueKey ¶
MakeDeletionQueueKey creates a deletion queue key for a file Format: !del/<timestamp>/<filepath>
func MakeFifoBackrefKey ¶ added in v1.8.0
MakeFifoBackrefKey creates the FIFO secondary-index key mapping a cache key to its current FIFO entry. Format: !fifo_ref/<key>
func MakeFifoIndexKey ¶ added in v1.8.0
MakeFifoIndexKey creates a FIFO eviction index key that embeds the write time so entries sort oldest-written first. Format: !fifo/<write_time_nano>/<key>
func MakeMetadataKey ¶
MakeMetadataKey creates a metadata key by adding the metadata prefix to the user key
func MakeSyncKey ¶
MakeSyncKey creates a sync index key for a file
func ParseBucketedAccessKey ¶
ParseBucketedAccessKey extracts components from a bucketed access key Returns: original key, access time, error
func ParseCompactionIndexRow ¶
ParseCompactionIndexRow extracts userKey, filePath and size from RocksDB file-index key/value pairs. Returns ok=false when the row does not follow the expected format.
func ParseDeletionQueueKey ¶
ParseDeletionQueueKey extracts timestamp and filepath from a deletion queue key
func ParseFifoIndexKey ¶ added in v1.8.0
ParseFifoIndexKey extracts the original user key from a FIFO index key. Format: !fifo/<19-digit nano>/<key>
func ParseFifoIndexTime ¶ added in v1.13.0
ParseFifoIndexTime extracts the write time embedded in a FIFO index key. Format: !fifo/<19-digit nano>/<key>
Types ¶
This section is empty.