mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-18 12:22:12 +00:00
97f2a2213e
* Move some code outside dbms/src folder * Fix paths
35 lines
819 B
C++
35 lines
819 B
C++
#pragma once
|
|
|
|
#include <Compression/ICompressionCodec.h>
|
|
|
|
namespace DB
|
|
{
|
|
|
|
class CompressionCodecDelta : public ICompressionCodec
|
|
{
|
|
public:
|
|
CompressionCodecDelta(UInt8 delta_bytes_size_);
|
|
|
|
uint8_t getMethodByte() const override;
|
|
|
|
String getCodecDesc() const override;
|
|
|
|
void useInfoAboutType(DataTypePtr data_type) override;
|
|
|
|
protected:
|
|
UInt32 doCompressData(const char * source, UInt32 source_size, char * dest) const override;
|
|
|
|
void doDecompressData(const char * source, UInt32 source_size, char * dest, UInt32 uncompressed_size) const override;
|
|
|
|
UInt32 getMaxCompressedDataSize(UInt32 uncompressed_size) const override { return uncompressed_size + 2; }
|
|
|
|
|
|
private:
|
|
UInt8 delta_bytes_size;
|
|
};
|
|
|
|
class CompressionCodecFactory;
|
|
void registerCodecDelta(CompressionCodecFactory & factory);
|
|
|
|
}
|