Check if the Record Header is valid at the beginning of range. Useful to check the validity of the header before building the entire record in IOBuf. If the record is from storage device (e.g. flash) then, it is better to make sure that the header is valid before reading the data from the storage device. Returns true if valid, false otherwise.

Synopsis

Declared in <folly/io/RecordIO.h>

bool
validateRecordHeader(
    ByteRange range,
    uint32_t fileId);

Return Value

true if the header is valid.

Parameters

Name

Description

range

The range whose leading header is checked.

fileId

The file id to match, or 0 to match any.

Created with MrDocs