Table of Contents

Class LiveFileStorageInfo

Namespace
RocksDbNet
Assembly
RocksDb.Net.dll

One file belonging to a consistent snapshot of the database, described in enough detail to copy it elsewhere. Maps to one entry of rocksdb_livefiles_storage_info_t.

public sealed record LiveFileStorageInfo : IEquatable<LiveFileStorageInfo>
Inheritance
LiveFileStorageInfo
Implements
Inherited Members

Remarks

Everything needed to reproduce the file is here: where it lives, what to call it in the copy, how many of its bytes are actually live, and for small metadata files the content to write instead of copying.

Properties

Directory

Directory the file currently lives in.

public string? Directory { get; init; }

Property Value

string

FileChecksum

The file's checksum as raw bytes, since a checksum is not text. Empty when IncludeChecksumInfo was not set, when no checksum was recorded, or when the algorithm that produced it is one this library cannot size.

public byte[] FileChecksum { get; init; }

Property Value

byte[]

Remarks

That last case needs explaining, because it is a limitation of the C API rather than a choice. The native accessor returns the checksum as a C string with no length, so the only way to know how many bytes to read is to recognise the algorithm from FileChecksumFuncName. CRC32C, four bytes, is the only generator the C API can install and therefore the only one recognised here. A database written by an application using a different generator reports its name but an empty checksum, because guessing a length would mean handing back bytes that are not the checksum.

FileChecksumFuncName

Name of the function that produced FileChecksum, or empty when there is none.

public string? FileChecksumFuncName { get; init; }

Property Value

string

FileNumber

RocksDb's file number for this file, or 0 for files that do not have one.

public ulong FileNumber { get; init; }

Property Value

ulong

FileType

The kind of file this is.

public FileType FileType { get; init; }

Property Value

FileType

RelativeFilename

Name the file should have in the copy, relative to its directory.

public string? RelativeFilename { get; init; }

Property Value

string

ReplacementContents

Content to write into the copy instead of reading the original, or empty when the file should simply be copied. RocksDb supplies this for small metadata files such as CURRENT.

public byte[] ReplacementContents { get; init; }

Property Value

byte[]

Size

Size in bytes.

public ulong Size { get; init; }

Property Value

ulong

Temperature

Storage temperature RocksDb has assigned to the file.

public Temperature Temperature { get; init; }

Property Value

Temperature

TrimToSize

Whether only the first Size bytes are live, so a copy should be truncated to that length. True for files RocksDb is still appending to, such as the current WAL.

public bool TrimToSize { get; init; }

Property Value

bool