Skip to content

Commit d51f047

Browse files
authored
chore: adjust comments (#187)
1 parent 5a16a0f commit d51f047

4 files changed

Lines changed: 37 additions & 55 deletions

File tree

src/paimon/common/compression/block_compressor.h

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -29,31 +29,25 @@ class BlockCompressor {
2929
virtual ~BlockCompressor() = default;
3030

3131
public:
32-
/**
33-
* Get the max compressed size for a given original size.
34-
* @param src_size The original size
35-
* @return The max compressed size
36-
*/
32+
/// Get the max compressed size for a given original size.
33+
/// @param src_size The original size
34+
/// @return The max compressed size
3735
virtual int32_t GetMaxCompressedSize(int32_t src_size) = 0;
3836

39-
/**
40-
* Compress data read from src, and write the compressed data to dst.
41-
*
42-
* @param src Uncompressed data to read from
43-
* @param src_length The length of data which want to be compressed
44-
* @param dst The target to write compressed data
45-
* @param dst_length The max length of data
46-
* @return Length of compressed data
47-
*/
4837
/// Compress data read from src, and write the compressed data to dst.
38+
///
39+
/// @param src Uncompressed data to read from
40+
/// @param src_length The length of data which want to be compressed
41+
/// @param dst The target to write compressed data
42+
/// @param dst_length The max length of data
43+
/// @return Length of compressed data
4944
virtual Result<int32_t> Compress(const char* src, int32_t src_length, char* dst,
5045
int32_t dst_length) = 0;
5146

5247
public:
53-
/**
54-
* We put two integers before each compressed block, the first integer represents the compressed
55-
* length of the block, and the second one represents the original length of the block.
56-
*/
48+
/// We put two integers before each compressed block, the first integer represents the
49+
/// compressed length of the block, and the second one represents the original length of the
50+
/// block.
5751
static constexpr int32_t HEADER_LENGTH = 8;
5852
};
5953
} // namespace paimon

src/paimon/common/compression/block_decompressor.h

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,13 @@ class BlockDecompressor {
3131
virtual ~BlockDecompressor() = default;
3232

3333
public:
34-
/**
35-
* Decompress data read from src, and write the decompressed data to dst.
36-
*
37-
* @param src Compressed data to read from
38-
* @param src_length The length of data which want to be decompressed
39-
* @param dst The target to write decompressed data
40-
* @param dst_length The max length of data
41-
* @return Length of decompressed data
42-
*/
34+
/// Decompress data read from src, and write the decompressed data to dst.
35+
///
36+
/// @param src Compressed data to read from
37+
/// @param src_length The length of data which want to be decompressed
38+
/// @param dst The target to write decompressed data
39+
/// @param dst_length The max length of data
40+
/// @return Length of decompressed data
4341
virtual Result<int32_t> Decompress(const char* src, int32_t src_length, char* dst,
4442
int32_t dst_length) = 0;
4543

src/paimon/common/sst/sst_file_reader.h

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -46,30 +46,24 @@ class SstFileReader {
4646

4747
std::unique_ptr<SstFileIterator> CreateIterator();
4848

49-
/**
50-
* Lookup the specified key in the file.
51-
*
52-
* @param key serialized key
53-
* @return corresponding serialized value, nullptr if not found.
54-
*/
49+
/// Lookup the specified key in the file.
50+
///
51+
/// @param key serialized key
52+
/// @return corresponding serialized value, nullptr if not found.
5553
Result<std::shared_ptr<Bytes>> Lookup(const std::shared_ptr<Bytes>& key);
5654

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

60-
/**
61-
* @param handle The block handle.
62-
* @param index Whether read the block as an index.
63-
* @return The reader of the target block.
64-
*/
58+
/// @param handle The block handle.
59+
/// @param index Whether read the block as an index.
60+
/// @return The reader of the target block.
6561
Result<std::shared_ptr<BlockReader>> ReadBlock(std::shared_ptr<BlockHandle>&& handle,
6662
bool index);
6763

68-
/**
69-
* @param handle The block handle.
70-
* @param index Whether read the block as an index.
71-
* @return The reader of the target block.
72-
*/
64+
/// @param handle The block handle.
65+
/// @param index Whether read the block as an index.
66+
/// @return The reader of the target block.
7367
Result<std::shared_ptr<BlockReader>> ReadBlock(const std::shared_ptr<BlockHandle>& handle,
7468
bool index);
7569

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

101-
/**
102-
* Seek to the position of the record whose key is exactly equal to or greater than the
103-
* specified key.
104-
*/
95+
/// Seek to the position of the record whose key is exactly equal to or greater than the
96+
/// specified key.
10597
Status SeekTo(const std::shared_ptr<Bytes>& key);
10698

10799
private:

src/paimon/common/utils/crc32c.h

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,12 @@ class PAIMON_EXPORT CRC32C {
3232

3333
private:
3434
#if defined(PAIMON_HAVE_SSE4_2)
35-
/**
36-
* Simd implementation for crc32c.
37-
*
38-
* @param data data to be calculated
39-
* @param length length of data
40-
* @param crc initial crc value
41-
* @return crc32c value
42-
*/
35+
/// Simd implementation for crc32c.
36+
///
37+
/// @param data data to be calculated
38+
/// @param length length of data
39+
/// @param crc initial crc value
40+
/// @return crc32c value
4341
static uint32_t crc32c_hw(const char* data, size_t length, uint32_t crc);
4442
#endif
4543
};

0 commit comments

Comments
 (0)