mirror of
https://github.com/postgres/postgres.git
synced 2025-11-09 06:21:09 +03:00
Remove WalCompressionMethod in favor of pg_compress_algorithm
The same structure, with the same set of elements (for none, lz4, gzip and zstd), exists in compression.h, so let's make use of the centralized version instead of duplicating things. Some of the variables used previously for WalCompressionMethod are renamed to stick better with the new structure and routine names. WalCompressionMethod was leading to some confusion in walmethods.c, as it was sometimes used to refer to some data unrelated to WAL. Reported-by: Robert Haas Author: Michael Paquier Reviewed-by: Robert Haas, Georgios Kokolatos Discussion: https://postgr.es/m/YlPQGNAAa04raObK@paquier.xyz
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#include "common/compression.h"
|
||||
|
||||
typedef void *Walfile;
|
||||
|
||||
@@ -19,15 +20,6 @@ typedef enum
|
||||
CLOSE_NO_RENAME
|
||||
} WalCloseMethod;
|
||||
|
||||
/* Types of compression supported */
|
||||
typedef enum
|
||||
{
|
||||
COMPRESSION_GZIP,
|
||||
COMPRESSION_LZ4,
|
||||
COMPRESSION_ZSTD,
|
||||
COMPRESSION_NONE
|
||||
} WalCompressionMethod;
|
||||
|
||||
/*
|
||||
* A WalWriteMethod structure represents the different methods used
|
||||
* to write the streaming WAL as it's received.
|
||||
@@ -68,7 +60,7 @@ struct WalWriteMethod
|
||||
char *(*get_file_name) (const char *pathname, const char *temp_suffix);
|
||||
|
||||
/* Returns the compression method */
|
||||
WalCompressionMethod (*compression_method) (void);
|
||||
pg_compress_algorithm (*compression_algorithm) (void);
|
||||
|
||||
/*
|
||||
* Write count number of bytes to the file, and return the number of bytes
|
||||
@@ -104,10 +96,10 @@ struct WalWriteMethod
|
||||
* not all those required for pg_receivewal)
|
||||
*/
|
||||
WalWriteMethod *CreateWalDirectoryMethod(const char *basedir,
|
||||
WalCompressionMethod compression_method,
|
||||
pg_compress_algorithm compression_algo,
|
||||
int compression, bool sync);
|
||||
WalWriteMethod *CreateWalTarMethod(const char *tarbase,
|
||||
WalCompressionMethod compression_method,
|
||||
pg_compress_algorithm compression_algo,
|
||||
int compression, bool sync);
|
||||
|
||||
/* Cleanup routines for previously-created methods */
|
||||
|
||||
Reference in New Issue
Block a user