2019-01-14 11:55:53 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <Compression/ICompressionCodec.h>
|
2019-03-30 20:52:36 +00:00
|
|
|
|
2019-01-14 11:55:53 +00:00
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
|
|
|
class CompressionCodecDelta : public ICompressionCodec
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CompressionCodecDelta(UInt8 delta_bytes_size_);
|
|
|
|
|
2020-01-03 14:39:24 +00:00
|
|
|
uint8_t getMethodByte() const override;
|
2019-01-14 11:55:53 +00:00
|
|
|
|
2020-09-03 22:04:46 +00:00
|
|
|
void updateHash(SipHash & hash) const override;
|
|
|
|
|
2019-01-14 11:55:53 +00:00
|
|
|
protected:
|
2020-09-03 22:04:46 +00:00
|
|
|
|
2019-01-14 11:55:53 +00:00
|
|
|
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;
|
|
|
|
|
2019-01-15 14:20:34 +00:00
|
|
|
UInt32 getMaxCompressedDataSize(UInt32 uncompressed_size) const override { return uncompressed_size + 2; }
|
2019-04-02 12:51:31 +00:00
|
|
|
|
2020-05-04 00:11:49 +00:00
|
|
|
bool isCompression() const override { return false; }
|
|
|
|
bool isGenericCompression() const override { return false; }
|
2019-04-02 12:51:31 +00:00
|
|
|
|
2019-01-14 11:55:53 +00:00
|
|
|
private:
|
2019-04-02 12:51:31 +00:00
|
|
|
UInt8 delta_bytes_size;
|
2019-01-14 11:55:53 +00:00
|
|
|
};
|
2019-03-30 20:52:36 +00:00
|
|
|
|
2019-01-14 11:55:53 +00:00
|
|
|
}
|