Go to the source code of this file.
◆ astreamer_lz4_compressor_new()
Definition at line 74 of file astreamer_lz4.c.
77 astreamer_lz4_frame *streamer;
78 LZ4F_errorCode_t ctxError;
79 LZ4F_preferences_t *prefs;
83 streamer =
palloc0(
sizeof(astreamer_lz4_frame));
85 &astreamer_lz4_compressor_ops;
87 streamer->base.bbs_next =
next;
89 streamer->header_written =
false;
92 prefs = &streamer->prefs;
93 memset(prefs, 0,
sizeof(LZ4F_preferences_t));
94 prefs->frameInfo.blockSizeID = LZ4F_max256KB;
95 prefs->compressionLevel = compress->
level;
97 ctxError = LZ4F_createCompressionContext(&streamer->cctx, LZ4F_VERSION);
98 if (LZ4F_isError(ctxError))
99 pg_log_error(
"could not create lz4 compression context: %s",
100 LZ4F_getErrorName(ctxError));
102 return &streamer->base;
104 pg_fatal(
"this build does not support compression with %s",
"LZ4");
#define Assert(condition)
#define pg_log_error(...)
void * palloc0(Size size)
void initStringInfo(StringInfo str)
References Assert, initStringInfo(), pg_compress_specification::level, next, palloc0(), pg_fatal, and pg_log_error.
Referenced by CreateBackupStreamer().
◆ astreamer_lz4_decompressor_new()
Definition at line 279 of file astreamer_lz4.c.
282 astreamer_lz4_frame *streamer;
283 LZ4F_errorCode_t ctxError;
287 streamer =
palloc0(
sizeof(astreamer_lz4_frame));
289 &astreamer_lz4_decompressor_ops;
291 streamer->base.bbs_next =
next;
295 ctxError = LZ4F_createDecompressionContext(&streamer->dctx, LZ4F_VERSION);
296 if (LZ4F_isError(ctxError))
297 pg_fatal(
"could not initialize compression library: %s",
298 LZ4F_getErrorName(ctxError));
300 return &streamer->base;
302 pg_fatal(
"this build does not support compression with %s",
"LZ4");
References Assert, initStringInfo(), next, palloc0(), and pg_fatal.
Referenced by create_archive_verifier(), and CreateBackupStreamer().