Documentation
¶
Index ¶
- Variables
- func GetMetadata(meta *metadata.MetaDB, key string) (*pb.ValueMessage, error)
- func HashString(s string) uint32
- func ValidateFileEntry(metadata *pb.ValueMessage, filePath string, context string, key string) error
- func WrapError(op string, path string, err error) error
- type FileSizeMismatchError
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrMetadataNotFound indicates the metadata doesn't exist ErrMetadataNotFound = errors.New("metadata not found") // ErrAlreadyCompacted indicates the file has already been compacted to a segment ErrAlreadyCompacted = errors.New("already compacted") // ErrNotRawFile indicates the value is not a raw file (could be inline or other type) ErrNotRawFile = errors.New("not raw file") // ErrFilePathMismatch indicates the metadata points to a different file ErrFilePathMismatch = errors.New("file path mismatch") // ErrMalformedIndexRow indicates the compaction index row is malformed ErrMalformedIndexRow = errors.New("malformed index row") // ErrFileNotExist indicates the file doesn't exist on disk ErrFileNotExist = errors.New("file does not exist") // ErrEntryStale indicates a sync entry is stale (metadata changed or missing) ErrEntryStale = errors.New("sync entry is stale") // ErrFileCorrupted indicates a file is corrupted (size mismatch) ErrFileCorrupted = errors.New("file corrupted: size mismatch") )
Sentinel errors for stale file validation
Functions ¶
func GetMetadata ¶
GetMetadata fetches metadata from the metaDB
func HashString ¶
HashString returns a simple hash of a string for partitioning work
func ValidateFileEntry ¶
func ValidateFileEntry(metadata *pb.ValueMessage, filePath string, context string, key string) error
ValidateFileEntry checks if a file entry is valid by validating against provided metadata. Returns nil if the entry is valid, or a specific error if it's stale: - ErrMetadataNotFound: The metadata is nil (doesn't exist) - ErrAlreadyCompacted: The file has been compacted to a segment - ErrNotRawFile: The value is not a raw file (could be inline or other type) - ErrFilePathMismatch: The metadata points to a different file path
Types ¶
type FileSizeMismatchError ¶
type FileSizeMismatchError struct {
Key string
FilePath string
ActualSize int64
ExpectedSize int64
}
FileSizeMismatchError represents a file size mismatch error with details
func (*FileSizeMismatchError) Error ¶
func (e *FileSizeMismatchError) Error() string
func (*FileSizeMismatchError) Is ¶
func (e *FileSizeMismatchError) Is(target error) bool
Click to show internal directories.
Click to hide internal directories.