24#ifndef GCS_MESSAGE_STAGE_LZ4_H
25#define GCS_MESSAGE_STAGE_LZ4_H
44 uint64_t
const &original_payload_size)
const override;
77 unsigned long long compress_threshold)
103 LZ4_MAX_INPUT_SIZE <= std::numeric_limits<int>::max(),
104 "Maximum input size for lz compression exceeds the expected value");
105 return LZ4_MAX_INPUT_SIZE;
131 unsigned long long compress_threshold)
157 unsigned long long compress_threshold)
Definition: gcs_message_stage_lz4.h:116
Gcs_message_stage_lz4_v2()
Creates an instance of the stage with the default threshold in bytes.
Definition: gcs_message_stage_lz4.h:121
Gcs_message_stage_lz4_v2(bool enabled, unsigned long long compress_threshold)
Creates an instance of the stage with the given threshold in bytes.
Definition: gcs_message_stage_lz4.h:130
Stage_code get_stage_code() const override
Return the unique stage code.
Definition: gcs_message_stage_lz4.h:139
~Gcs_message_stage_lz4_v2() override=default
Definition: gcs_message_stage_lz4.h:142
~Gcs_message_stage_lz4_v3() override
Definition: gcs_message_stage_lz4.h:160
Gcs_message_stage_lz4_v3()
Creates an instance of the stage with the default threshold in bytes.
Definition: gcs_message_stage_lz4.h:147
Gcs_message_stage_lz4_v3(bool enabled, unsigned long long compress_threshold)
Creates an instance of the stage with the given threshold in bytes.
Definition: gcs_message_stage_lz4.h:156
Stage_code get_stage_code() const override
Return the unique stage code.
Definition: gcs_message_stage_lz4.h:165
This class implements LZ4 compression.
Definition: gcs_message_stage_lz4.h:38
std::pair< bool, std::vector< Gcs_packet > > apply_transformation(Gcs_packet &&packet) override
Implements the logic of this stage's transformation to the packet, and returns a set of one,...
Definition: gcs_message_stage_lz4.cc:68
void set_threshold(unsigned long long threshold)
Sets the threshold in bytes after which compression kicks in.
Definition: gcs_message_stage_lz4.h:93
static constexpr unsigned long long DEFAULT_THRESHOLD
The default threshold value in bytes.
Definition: gcs_message_stage_lz4.h:62
Gcs_message_stage_lz4(bool enabled, unsigned long long compress_threshold)
Creates an instance of the stage with the given threshold in bytes.
Definition: gcs_message_stage_lz4.h:76
static constexpr unsigned long long max_input_compression() noexcept
Return the maximum payload size in bytes that can be compressed.
Definition: gcs_message_stage_lz4.h:98
Gcs_message_stage::stage_status skip_apply(uint64_t const &original_payload_size) const override
Check if the apply operation which affects outgoing packets should be executed (i....
Definition: gcs_message_stage_lz4.cc:36
~Gcs_message_stage_lz4() override=default
unsigned long long m_threshold
This marks the threshold in bytes above which a message gets compressed.
Definition: gcs_message_stage_lz4.h:113
Gcs_message_stage_lz4()
Creates an instance of the stage with the default threshold in bytes set.
Definition: gcs_message_stage_lz4.h:67
std::pair< Gcs_pipeline_incoming_result, Gcs_packet > revert_transformation(Gcs_packet &&packet) override
Implements the logic to revert this stage's transformation to the packet, and returns one,...
Definition: gcs_message_stage_lz4.cc:113
std::unique_ptr< Gcs_stage_metadata > get_stage_header() override
Definition: gcs_message_stage_lz4.cc:63
Gcs_message_stage::stage_status skip_revert(const Gcs_packet &packet) const override
Check if the revert operation which affects incoming packets should be executed (i....
Definition: gcs_message_stage_lz4.cc:167
Stage_code get_stage_code() const override
Return the unique stage code.
Definition: gcs_message_stage_lz4.h:85
This is a stage in the pipeline that processes messages when they are put through the send and receiv...
Definition: gcs_message_stages.h:82
stage_status
Definition: gcs_message_stages.h:84
This class is an abstraction for the packet concept.
Definition: gcs_internal_message.h:58
required bool enabled
Definition: replication_group_member_actions.proto:33