folly::recordio_helpers::findRecord

Search for the first valid record that begins in searchRange (which must be a subrange of wholeRange). Returns the record data (not the header) if found, ByteRange() otherwise.

Synopsis

Declared in <folly/io/RecordIO.h>

RecordInfo
findRecord(
    ByteRange searchRange,
    ByteRange wholeRange,
    uint32_t fileId);

Description

The fileId may be 0, in which case we'll return the first valid record for any fileId, or non-zero, in which case we'll only look for records with the requested fileId.

Return Value

The first valid record found, or an empty record.

Parameters

NameDescription
searchRangeThe subrange to search for a record start.
wholeRangeThe full range the record may extend into.
fileIdThe file id to match, or 0 to match any.