]>
git.proxmox.com Git - ceph.git/blob - ceph/src/compressor/zlib/ZlibCompressor.h
1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
4 * Ceph - scalable distributed file system
6 * Copyright (C) 2015 Mirantis, Inc.
8 * Author: Alyona Kiseleva <akiselyova@mirantis.com>
10 * This library is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU Lesser General Public
12 * License as published by the Free Software Foundation; either
13 * version 2.1 of the License, or (at your option) any later version.
17 #ifndef CEPH_COMPRESSION_ZLIB_H
18 #define CEPH_COMPRESSION_ZLIB_H
20 #include "compressor/Compressor.h"
22 class ZlibCompressor
: public Compressor
{
24 CephContext
*const cct
;
26 ZlibCompressor(CephContext
*cct
, bool isal
)
27 : Compressor(COMP_ALG_ZLIB
, "zlib"), isal_enabled(isal
), cct(cct
) {}
29 int compress(const bufferlist
&in
, bufferlist
&out
) override
;
30 int decompress(const bufferlist
&in
, bufferlist
&out
) override
;
31 int decompress(bufferlist::iterator
&p
, size_t compressed_len
, bufferlist
&out
) override
;
33 int zlib_compress(const bufferlist
&in
, bufferlist
&out
);
34 int isal_compress(const bufferlist
&in
, bufferlist
&out
);