proxygen
|
Namespaces | |
recordio_detail | |
Classes | |
struct | RecordInfo |
Functions | |
constexpr size_t | headerSize () |
RecordInfo | findRecord (ByteRange range, uint32_t fileId) |
size_t | prependHeader (std::unique_ptr< IOBuf > &buf, uint32_t fileId) |
RecordInfo | validateRecord (ByteRange range, uint32_t fileId) |
RecordInfo | findRecord (ByteRange searchRange, ByteRange wholeRange, uint32_t fileId) |
|
inline |
Search for the first valid record in range.
Definition at line 105 of file RecordIO-inl.h.
RecordInfo folly::recordio_helpers::findRecord | ( | ByteRange | searchRange, |
ByteRange | wholeRange, | ||
uint32_t | fileId | ||
) |
Definition at line 193 of file RecordIO.cpp.
References folly::Range< Iter >::begin(), folly::RecordIOReader::end(), folly::Range< Iter >::end(), folly::Range< Iter >::find(), folly::bser::kMagic, min, folly::Range< const unsigned char * >::npos, start, uint32_t, uint8_t, and validateRecord().
Referenced by folly::RecordIOReader::Iterator::advanceToValid().
constexpr size_t folly::recordio_helpers::headerSize | ( | ) |
Header size.
Definition at line 101 of file RecordIO-inl.h.
Referenced by folly::RecordIOReader::Iterator::advanceToValid(), getTracepointArguments(), folly::RecordIOReader::Iterator::increment(), HTTP1xCodecCallback::onHeadersComplete(), prependHeader(), folly::test::TEST(), and validateRecord().
size_t folly::recordio_helpers::prependHeader | ( | std::unique_ptr< IOBuf > & | buf, |
uint32_t | fileId = 1 |
||
) |
Write a header in the buffer. We will prepend the header to the front of the chain. Do not write the buffer if empty (we don't allow empty records). Returns the total length, including header (0 if empty) (same as buf->computeChainDataLength(), but likely faster)
The fileId should be unique per stream and allows you to have RecordIO headers stored inside the data (for example, have an entire RecordIO file stored as a record inside another RecordIO file). The fileId may not be 0.
Definition at line 139 of file RecordIO.cpp.
References b, folly::IOBuf::create(), headerSize(), folly::bser::kMagic, folly::gen::move, and uint32_t.
Referenced by folly::RecordIOWriter::write().
RecordInfo folly::recordio_helpers::validateRecord | ( | ByteRange | range, |
uint32_t | fileId | ||
) |
Check if there is a valid record at the beginning of range. Returns the record data (not the header) if the record is valid, ByteRange() otherwise.
Definition at line 170 of file RecordIO.cpp.
References folly::Range< Iter >::advance(), folly::Range< Iter >::begin(), headerSize(), folly::bser::kMagic, folly::Range< Iter >::reset(), and folly::Range< Iter >::size().
Referenced by findRecord().