23#ifndef GCS_MESSAGE_STAGE_LZ4_H
24#define GCS_MESSAGE_STAGE_LZ4_H
43 uint64_t
const &original_payload_size)
const override;
76 unsigned long long compress_threshold)
102 LZ4_MAX_INPUT_SIZE <= std::numeric_limits<int>::max(),
103 "Maximum input size for lz compression exceeds the expected value");
104 return LZ4_MAX_INPUT_SIZE;
130 unsigned long long compress_threshold)
156 unsigned long long compress_threshold)
Definition: gcs_message_stage_lz4.h:115
Gcs_message_stage_lz4_v2()
Creates an instance of the stage with the default threshold in bytes.
Definition: gcs_message_stage_lz4.h:120
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:129
Stage_code get_stage_code() const override
Return the unique stage code.
Definition: gcs_message_stage_lz4.h:138
~Gcs_message_stage_lz4_v2() override=default
Definition: gcs_message_stage_lz4.h:141
~Gcs_message_stage_lz4_v3() override
Definition: gcs_message_stage_lz4.h:159
Gcs_message_stage_lz4_v3()
Creates an instance of the stage with the default threshold in bytes.
Definition: gcs_message_stage_lz4.h:146
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:155
Stage_code get_stage_code() const override
Return the unique stage code.
Definition: gcs_message_stage_lz4.h:164
This class implements LZ4 compression.
Definition: gcs_message_stage_lz4.h:37
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:67
void set_threshold(unsigned long long threshold)
Sets the threshold in bytes after which compression kicks in.
Definition: gcs_message_stage_lz4.h:92
static constexpr unsigned long long DEFAULT_THRESHOLD
The default threshold value in bytes.
Definition: gcs_message_stage_lz4.h:61
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:75
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:97
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:35
~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:112
Gcs_message_stage_lz4()
Creates an instance of the stage with the default threshold in bytes set.
Definition: gcs_message_stage_lz4.h:66
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:112
std::unique_ptr< Gcs_stage_metadata > get_stage_header() override
Definition: gcs_message_stage_lz4.cc:62
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:166
Stage_code get_stage_code() const override
Return the unique stage code.
Definition: gcs_message_stage_lz4.h:84
This is a stage in the pipeline that processes messages when they are put through the send and receiv...
Definition: gcs_message_stages.h:81
stage_status
Definition: gcs_message_stages.h:83
This class is an abstraction for the packet concept.
Definition: gcs_internal_message.h:57
required bool enabled
Definition: replication_group_member_actions.proto:32