MCPcopy Create free account
hub / github.com/ClickHouse/ClickHouse / compress

Method compress

src/Compression/ICompressionCodec.cpp:85–98  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

83}
84
85UInt32 ICompressionCodec::compress(const char * source, UInt32 source_size, char * dest) const
86{
87 chassert(source != nullptr && dest != nullptr);
88
89 CurrentMetrics::Increment metric_increment(CurrentMetrics::Compressing);
90
91 dest[0] = getMethodByte();
92 UInt8 header_size = getHeaderSize();
93 /// Write data from header_size
94 UInt32 compressed_bytes_written = doCompressData(source, source_size, &dest[header_size]);
95 unalignedStoreLittleEndian<UInt32>(&dest[1], compressed_bytes_written + header_size);
96 unalignedStoreLittleEndian<UInt32>(&dest[5], source_size);
97 return header_size + compressed_bytes_written;
98}
99
100UInt32 ICompressionCodec::decompress(const char * source, UInt32 source_size, char * dest) const
101{

Callers 6

encryptValueMethod · 0.45
nextImplMethod · 0.45
doCompressDataMethod · 0.45
testTranscodingFunction · 0.45
TEST_PFunction · 0.45
TESTFunction · 0.45

Calls

no outgoing calls

Tested by 3

testTranscodingFunction · 0.36
TEST_PFunction · 0.36
TESTFunction · 0.36