0.9.8.10
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
BlockCompressionCodecSnappy.h
Go to the documentation of this file.
1 /* -*- c++ -*-
2  * Copyright (C) 2007-2015 Hypertable, Inc.
3  *
4  * This file is part of Hypertable.
5  *
6  * Hypertable is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; version 3 of the
9  * License, or any later version.
10  *
11  * Hypertable is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19  * 02110-1301, USA.
20  */
21 
26 
27 #ifndef HYPERTABLE_BLOCKCOMPRESSIONCODECSNAPPY_H
28 #define HYPERTABLE_BLOCKCOMPRESSIONCODECSNAPPY_H
29 
31 
32 #include <snappy.h>
33 
34 namespace Hypertable {
35 
38 
45 
46  public:
47 
53  BlockCompressionCodecSnappy(const Args &args) { set_args(args); }
54 
57 
78  virtual void deflate(const DynamicBuffer &input, DynamicBuffer &output,
79  BlockHeader &header, size_t reserve=0);
80 
86  virtual void inflate(const DynamicBuffer &input, DynamicBuffer &output,
87  BlockHeader &header);
88 
93  virtual int get_type() { return SNAPPY; }
94  };
95 
97 
98 }
99 
100 #endif // HYPERTABLE_BLOCKCOMPRESSIONCODECSNAPPY_H
101 
virtual void set_args(const Args &args)
Sets arguments to control compression behavior.
BlockCompressionCodecSnappy(const Args &args)
Constructor.
Declarations for BlockCompressionCodec.
A dynamic, resizable and reference counted memory buffer.
Definition: DynamicBuffer.h:42
std::vector< String > Args
Compression codec argument vector.
Block compressor that uses the SNAPPY algorithm.
virtual void inflate(const DynamicBuffer &input, DynamicBuffer &output, BlockHeader &header)
Decompresses a buffer compressed with the SNAPPY algorithm.
Hypertable definitions
virtual void deflate(const DynamicBuffer &input, DynamicBuffer &output, BlockHeader &header, size_t reserve=0)
Compresses a buffer using the SNAPPY algorithm.
virtual int get_type()
Returns enum value representing compression type SNAPPY.
Base class for block headers.
Definition: BlockHeader.h:48
Abstract base class for block compression codecs.