diff options
author | Robert Haas | 2024-08-07 12:49:41 +0000 |
---|---|---|
committer | Robert Haas | 2024-08-07 12:49:41 +0000 |
commit | 22b4a1b561f830f2af80c21450a4c05f6efbb698 (patch) | |
tree | 64d63c8157098c0e046583064ec1d6846e17750c /src/fe_utils | |
parent | 2676040df0b2ebbcf8af759dbe5d34f393c3d5b5 (diff) |
Improve file header comments for astramer code.
Make it clear that "astreamer" stands for "archive streamer".
Generalize comments that still believe this code can only be used
by pg_basebackup. Add some comments explaining the asymmetry
between the gzip, lz4, and zstd astreamers, in the hopes of making
life easier for anyone who hacks on this code in the future.
Robert Haas, reviewed by Amul Sul.
Discussion: http://postgr.es/m/CAAJ_b97O2kkKVTWxt8MxDN1o-cDfbgokqtiN2yqFf48=gXpcxQ@mail.gmail.com
Diffstat (limited to 'src/fe_utils')
-rw-r--r-- | src/fe_utils/astreamer_file.c | 4 | ||||
-rw-r--r-- | src/fe_utils/astreamer_gzip.c | 15 | ||||
-rw-r--r-- | src/fe_utils/astreamer_lz4.c | 4 | ||||
-rw-r--r-- | src/fe_utils/astreamer_zstd.c | 4 |
4 files changed, 27 insertions, 0 deletions
diff --git a/src/fe_utils/astreamer_file.c b/src/fe_utils/astreamer_file.c index 13d1192c6e6..c9a030853bc 100644 --- a/src/fe_utils/astreamer_file.c +++ b/src/fe_utils/astreamer_file.c @@ -2,6 +2,10 @@ * * astreamer_file.c * + * Archive streamers that write to files. astreamer_plain_writer writes + * the whole archive to a single file, and astreamer_extractor writes + * each archive member to a separate file in a given directory. + * * Portions Copyright (c) 1996-2024, PostgreSQL Global Development Group * * IDENTIFICATION diff --git a/src/fe_utils/astreamer_gzip.c b/src/fe_utils/astreamer_gzip.c index dd28defac7b..ed9ec50fedd 100644 --- a/src/fe_utils/astreamer_gzip.c +++ b/src/fe_utils/astreamer_gzip.c @@ -2,6 +2,21 @@ * * astreamer_gzip.c * + * Archive streamers that deal with data compressed using gzip. + * astreamer_gzip_writer applies gzip compression to the input data + * and writes the result to a file. astreamer_gzip_decompressor assumes + * that the input stream is compressed using gzip and decompresses it. + * + * Note that the code in this file is asymmetric with what we do for + * other compression types: for lz4 and zstd, there is a compressor and + * a decompressor, rather than a writer and a decompressor. The approach + * taken here is less flexible, because a writer can only write to a file, + * while a compressor can write to a subsequent astreamer which is free + * to do whatever it likes. The reason it's like this is because this + * code was adapated from old, less-modular pg_basebackup code that used + * the same APIs that astreamer_gzip_writer now uses, and it didn't seem + * necessary to change anything at the time. + * * Portions Copyright (c) 1996-2024, PostgreSQL Global Development Group * * IDENTIFICATION diff --git a/src/fe_utils/astreamer_lz4.c b/src/fe_utils/astreamer_lz4.c index d8b2a367e47..2bf14084e7f 100644 --- a/src/fe_utils/astreamer_lz4.c +++ b/src/fe_utils/astreamer_lz4.c @@ -2,6 +2,10 @@ * * astreamer_lz4.c * + * Archive streamers that deal with data compressed using lz4. + * astreamer_lz4_compressor applies lz4 compression to the input stream, + * and astreamer_lz4_decompressor does the reverse. + * * Portions Copyright (c) 1996-2024, PostgreSQL Global Development Group * * IDENTIFICATION diff --git a/src/fe_utils/astreamer_zstd.c b/src/fe_utils/astreamer_zstd.c index 45f6cb67363..4b2d42b2311 100644 --- a/src/fe_utils/astreamer_zstd.c +++ b/src/fe_utils/astreamer_zstd.c @@ -2,6 +2,10 @@ * * astreamer_zstd.c * + * Archive streamers that deal with data compressed using zstd. + * astreamer_zstd_compressor applies lz4 compression to the input stream, + * and astreamer_zstd_decompressor does the reverse. + * * Portions Copyright (c) 1996-2024, PostgreSQL Global Development Group * * IDENTIFICATION |