]>
git.proxmox.com Git - ceph.git/blob - ceph/src/rgw/rgw_compression.h
1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
4 #ifndef CEPH_RGW_COMPRESSION_H
5 #define CEPH_RGW_COMPRESSION_H
9 #include "compressor/Compressor.h"
10 #include "rgw_putobj.h"
13 class RGWGetObj_Decompress
: public RGWGetObj_Filter
16 CompressorRef compressor
;
17 RGWCompressionInfo
* cs_info
;
19 vector
<compression_block
>::iterator first_block
, last_block
;
24 RGWGetObj_Decompress(CephContext
* cct_
,
25 RGWCompressionInfo
* cs_info_
,
26 bool partial_content_
,
27 RGWGetObj_Filter
* next
);
28 ~RGWGetObj_Decompress() override
{}
30 int handle_data(bufferlist
& bl
, off_t bl_ofs
, off_t bl_len
) override
;
31 int fixup_range(off_t
& ofs
, off_t
& end
) override
;
35 class RGWPutObj_Compress
: public rgw::putobj::Pipe
38 bool compressed
{false};
39 CompressorRef compressor
;
40 std::vector
<compression_block
> blocks
;
42 RGWPutObj_Compress(CephContext
* cct_
, CompressorRef compressor
,
43 rgw::putobj::DataProcessor
*next
)
44 : Pipe(next
), cct(cct_
), compressor(compressor
) {}
46 int process(bufferlist
&& data
, uint64_t logical_offset
) override
;
48 bool is_compressed() { return compressed
; }
49 vector
<compression_block
>& get_compression_blocks() { return blocks
; }
51 }; /* RGWPutObj_Compress */
53 #endif /* CEPH_RGW_COMPRESSION_H */