OmniSciDB
a5dc49c757
|
#include <Compressor.h>
Public Member Functions | |
size_t | getScratchSpaceSize (const size_t len) const |
int64_t | compress (const uint8_t *buffer, const size_t buffer_size, uint8_t *compressed_buffer, const size_t compressed_buffer_size, const size_t min_compressor_bytes) |
std::string | compress (const std::string &buffer) |
size_t | decompress (const uint8_t *compressed_buffer, uint8_t *decompressed_buffer, const size_t decompressed_size) |
std::string | decompress (const std::string &buffer, const size_t decompressed_size) |
size_t | compressOrMemcpy (const uint8_t *input_buffer, uint8_t *output_buffer, const size_t uncompressed_size, const size_t min_compressor_bytes) |
bool | decompressOrMemcpy (const uint8_t *compressed_buffer, const size_t compressed_buffer_size, uint8_t *decompressed_buffer, const size_t decompressed_size) |
void | getBloscBufferSizes (const uint8_t *data_ptr, size_t *num_bytes_compressed, size_t *num_bytes_uncompressed, size_t *block_size) |
int | setThreads (size_t num_threads) |
int | setCompressor (std::string &compressor) |
~BloscCompressor () | |
Static Public Member Functions | |
static BloscCompressor * | getCompressor () |
Private Member Functions | |
BloscCompressor () | |
Private Attributes | |
std::mutex | compressor_lock |
Static Private Attributes | |
static BloscCompressor * | instance = NULL |
Definition at line 38 of file Compressor.h.
BloscCompressor::~BloscCompressor | ( | ) |
|
private |
Definition at line 37 of file Compressor.cpp.
References compressor_lock.
Referenced by getCompressor().
int64_t BloscCompressor::compress | ( | const uint8_t * | buffer, |
const size_t | buffer_size, | ||
uint8_t * | compressed_buffer, | ||
const size_t | compressed_buffer_size, | ||
const size_t | min_compressor_bytes = g_compression_limit_bytes |
||
) |
Definition at line 56 of file Compressor.cpp.
References compressor_lock, and to_string().
Referenced by compress(), and compressOrMemcpy().
std::string BloscCompressor::compress | ( | const std::string & | buffer | ) |
Definition at line 98 of file Compressor.cpp.
References compress(), and getScratchSpaceSize().
size_t BloscCompressor::compressOrMemcpy | ( | const uint8_t * | input_buffer, |
uint8_t * | output_buffer, | ||
const size_t | uncompressed_size, | ||
const size_t | min_compressor_bytes | ||
) |
Definition at line 160 of file Compressor.cpp.
References compress(), LOG, and logger::WARNING.
size_t BloscCompressor::decompress | ( | const uint8_t * | compressed_buffer, |
uint8_t * | decompressed_buffer, | ||
const size_t | decompressed_size | ||
) |
Definition at line 119 of file Compressor.cpp.
References compressor_lock, getBloscBufferSizes(), and to_string().
Referenced by decompress(), and decompressOrMemcpy().
std::string BloscCompressor::decompress | ( | const std::string & | buffer, |
const size_t | decompressed_size | ||
) |
Definition at line 145 of file Compressor.cpp.
References decompress().
bool BloscCompressor::decompressOrMemcpy | ( | const uint8_t * | compressed_buffer, |
const size_t | compressed_buffer_size, | ||
uint8_t * | decompressed_buffer, | ||
const size_t | decompressed_size | ||
) |
Definition at line 184 of file Compressor.cpp.
References decompress().
void BloscCompressor::getBloscBufferSizes | ( | const uint8_t * | data_ptr, |
size_t * | num_bytes_compressed, | ||
size_t * | num_bytes_uncompressed, | ||
size_t * | block_size | ||
) |
Definition at line 203 of file Compressor.cpp.
Referenced by decompress().
|
static |
Definition at line 212 of file Compressor.cpp.
References BloscCompressor(), and instance.
|
inline |
Definition at line 46 of file Compressor.h.
Referenced by compress().
int BloscCompressor::setCompressor | ( | std::string & | compressor | ) |
int BloscCompressor::setThreads | ( | size_t | num_threads | ) |
|
private |
Definition at line 87 of file Compressor.h.
Referenced by BloscCompressor(), compress(), decompress(), setCompressor(), setThreads(), and ~BloscCompressor().
|
staticprivate |
Definition at line 88 of file Compressor.h.
Referenced by getCompressor().