1 /*-------------------------------------------------------------------------
2  *
3  * columnar_compression.h
4  *
5  * Type and function declarations for compression methods.
6  *
7  * Copyright (c) Citus Data, Inc.
8  *
9  *-------------------------------------------------------------------------
10  */
11 
12 #ifndef COLUMNAR_COMPRESSION_H
13 #define COLUMNAR_COMPRESSION_H
14 
15 /* Enumaration for columnar table's compression method */
16 typedef enum
17 {
18 	COMPRESSION_TYPE_INVALID = -1,
19 	COMPRESSION_NONE = 0,
20 	COMPRESSION_PG_LZ = 1,
21 	COMPRESSION_LZ4 = 2,
22 	COMPRESSION_ZSTD = 3,
23 
24 	COMPRESSION_COUNT
25 } CompressionType;
26 
27 extern bool CompressBuffer(StringInfo inputBuffer,
28 						   StringInfo outputBuffer,
29 						   CompressionType compressionType,
30 						   int compressionLevel);
31 extern StringInfo DecompressBuffer(StringInfo buffer, CompressionType compressionType,
32 								   uint64 decompressedSize);
33 
34 #endif /* COLUMNAR_COMPRESSION_H */
35