Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 12 additions & 18 deletions src/paimon/common/compression/block_compressor.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,31 +29,25 @@ class BlockCompressor {
virtual ~BlockCompressor() = default;

public:
/**
* Get the max compressed size for a given original size.
* @param src_size The original size
* @return The max compressed size
*/
/// Get the max compressed size for a given original size.
/// @param src_size The original size
/// @return The max compressed size
virtual int32_t GetMaxCompressedSize(int32_t src_size) = 0;

/**
* Compress data read from src, and write the compressed data to dst.
*
* @param src Uncompressed data to read from
* @param src_length The length of data which want to be compressed
* @param dst The target to write compressed data
* @param dst_length The max length of data
* @return Length of compressed data
*/
/// Compress data read from src, and write the compressed data to dst.
///
/// @param src Uncompressed data to read from
/// @param src_length The length of data which want to be compressed
/// @param dst The target to write compressed data
/// @param dst_length The max length of data
/// @return Length of compressed data
virtual Result<int32_t> Compress(const char* src, int32_t src_length, char* dst,
int32_t dst_length) = 0;

public:
/**
* We put two integers before each compressed block, the first integer represents the compressed
* length of the block, and the second one represents the original length of the block.
*/
/// We put two integers before each compressed block, the first integer represents the
/// compressed length of the block, and the second one represents the original length of the
/// block.
static constexpr int32_t HEADER_LENGTH = 8;
};
} // namespace paimon
16 changes: 7 additions & 9 deletions src/paimon/common/compression/block_decompressor.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,13 @@ class BlockDecompressor {
virtual ~BlockDecompressor() = default;

public:
/**
* Decompress data read from src, and write the decompressed data to dst.
*
* @param src Compressed data to read from
* @param src_length The length of data which want to be decompressed
* @param dst The target to write decompressed data
* @param dst_length The max length of data
* @return Length of decompressed data
*/
/// Decompress data read from src, and write the decompressed data to dst.
///
/// @param src Compressed data to read from
/// @param src_length The length of data which want to be decompressed
/// @param dst The target to write decompressed data
/// @param dst_length The max length of data
/// @return Length of decompressed data
virtual Result<int32_t> Decompress(const char* src, int32_t src_length, char* dst,
int32_t dst_length) = 0;

Expand Down
32 changes: 12 additions & 20 deletions src/paimon/common/sst/sst_file_reader.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,30 +46,24 @@ class SstFileReader {

std::unique_ptr<SstFileIterator> CreateIterator();

/**
* Lookup the specified key in the file.
*
* @param key serialized key
* @return corresponding serialized value, nullptr if not found.
*/
/// Lookup the specified key in the file.
///
/// @param key serialized key
/// @return corresponding serialized value, nullptr if not found.
Result<std::shared_ptr<Bytes>> Lookup(const std::shared_ptr<Bytes>& key);

Result<std::unique_ptr<BlockIterator>> GetNextBlock(
std::unique_ptr<BlockIterator>& index_iterator);

/**
* @param handle The block handle.
* @param index Whether read the block as an index.
* @return The reader of the target block.
*/
/// @param handle The block handle.
/// @param index Whether read the block as an index.
/// @return The reader of the target block.
Result<std::shared_ptr<BlockReader>> ReadBlock(std::shared_ptr<BlockHandle>&& handle,
bool index);

/**
* @param handle The block handle.
* @param index Whether read the block as an index.
* @return The reader of the target block.
*/
/// @param handle The block handle.
/// @param index Whether read the block as an index.
/// @return The reader of the target block.
Result<std::shared_ptr<BlockReader>> ReadBlock(const std::shared_ptr<BlockHandle>& handle,
bool index);

Expand Down Expand Up @@ -98,10 +92,8 @@ class SstFileIterator {
public:
SstFileIterator(SstFileReader* reader, std::unique_ptr<BlockIterator> index_iterator);

/**
* Seek to the position of the record whose key is exactly equal to or greater than the
* specified key.
*/
/// Seek to the position of the record whose key is exactly equal to or greater than the
/// specified key.
Status SeekTo(const std::shared_ptr<Bytes>& key);

private:
Expand Down
14 changes: 6 additions & 8 deletions src/paimon/common/utils/crc32c.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,12 @@ class PAIMON_EXPORT CRC32C {

private:
#if defined(PAIMON_HAVE_SSE4_2)
/**
* Simd implementation for crc32c.
*
* @param data data to be calculated
* @param length length of data
* @param crc initial crc value
* @return crc32c value
*/
/// Simd implementation for crc32c.
///
/// @param data data to be calculated
/// @param length length of data
/// @param crc initial crc value
/// @return crc32c value
static uint32_t crc32c_hw(const char* data, size_t length, uint32_t crc);
#endif
};
Expand Down
Loading