mirror of https://github.com/facebook/rocksdb.git
Fix build issues
This commit is contained in:
parent
abb9b95ffe
commit
15d2abbec3
|
@ -45,6 +45,7 @@ int main() {
|
|||
#include "port/port.h"
|
||||
#include "port/stack_trace.h"
|
||||
#include "util/crc32c.h"
|
||||
#include "util/compression.h"
|
||||
#include "util/histogram.h"
|
||||
#include "util/mutexlock.h"
|
||||
#include "util/random.h"
|
||||
|
@ -1213,27 +1214,27 @@ class Benchmark {
|
|||
text[len] = '\0';
|
||||
switch (FLAGS_compression_type_e) {
|
||||
case kSnappyCompression:
|
||||
result = port::Snappy_Compress(Options().compression_opts, text,
|
||||
result = Snappy_Compress(Options().compression_opts, text,
|
||||
strlen(text), &compressed);
|
||||
name = "Snappy";
|
||||
break;
|
||||
case kZlibCompression:
|
||||
result = port::Zlib_Compress(Options().compression_opts, text,
|
||||
strlen(text), &compressed);
|
||||
result = Zlib_Compress(Options().compression_opts, text, strlen(text),
|
||||
&compressed);
|
||||
name = "Zlib";
|
||||
break;
|
||||
case kBZip2Compression:
|
||||
result = port::BZip2_Compress(Options().compression_opts, text,
|
||||
result = BZip2_Compress(Options().compression_opts, text,
|
||||
strlen(text), &compressed);
|
||||
name = "BZip2";
|
||||
break;
|
||||
case kLZ4Compression:
|
||||
result = port::LZ4_Compress(Options().compression_opts, text,
|
||||
strlen(text), &compressed);
|
||||
result = LZ4_Compress(Options().compression_opts, text, strlen(text),
|
||||
&compressed);
|
||||
name = "LZ4";
|
||||
break;
|
||||
case kLZ4HCCompression:
|
||||
result = port::LZ4HC_Compress(Options().compression_opts, text,
|
||||
result = LZ4HC_Compress(Options().compression_opts, text,
|
||||
strlen(text), &compressed);
|
||||
name = "LZ4HC";
|
||||
break;
|
||||
|
@ -1774,23 +1775,23 @@ class Benchmark {
|
|||
while (ok && bytes < int64_t(1) << 30) {
|
||||
switch (FLAGS_compression_type_e) {
|
||||
case rocksdb::kSnappyCompression:
|
||||
ok = port::Snappy_Compress(Options().compression_opts, input.data(),
|
||||
ok = Snappy_Compress(Options().compression_opts, input.data(),
|
||||
input.size(), &compressed);
|
||||
break;
|
||||
case rocksdb::kZlibCompression:
|
||||
ok = port::Zlib_Compress(Options().compression_opts, input.data(),
|
||||
ok = Zlib_Compress(Options().compression_opts, input.data(),
|
||||
input.size(), &compressed);
|
||||
break;
|
||||
case rocksdb::kBZip2Compression:
|
||||
ok = port::BZip2_Compress(Options().compression_opts, input.data(),
|
||||
ok = BZip2_Compress(Options().compression_opts, input.data(),
|
||||
input.size(), &compressed);
|
||||
break;
|
||||
case rocksdb::kLZ4Compression:
|
||||
ok = port::LZ4_Compress(Options().compression_opts, input.data(),
|
||||
ok = LZ4_Compress(Options().compression_opts, input.data(),
|
||||
input.size(), &compressed);
|
||||
break;
|
||||
case rocksdb::kLZ4HCCompression:
|
||||
ok = port::LZ4HC_Compress(Options().compression_opts, input.data(),
|
||||
ok = LZ4HC_Compress(Options().compression_opts, input.data(),
|
||||
input.size(), &compressed);
|
||||
break;
|
||||
default:
|
||||
|
@ -1820,23 +1821,23 @@ class Benchmark {
|
|||
bool ok;
|
||||
switch (FLAGS_compression_type_e) {
|
||||
case rocksdb::kSnappyCompression:
|
||||
ok = port::Snappy_Compress(Options().compression_opts, input.data(),
|
||||
ok = Snappy_Compress(Options().compression_opts, input.data(),
|
||||
input.size(), &compressed);
|
||||
break;
|
||||
case rocksdb::kZlibCompression:
|
||||
ok = port::Zlib_Compress(Options().compression_opts, input.data(),
|
||||
input.size(), &compressed);
|
||||
ok = Zlib_Compress(Options().compression_opts, input.data(), input.size(),
|
||||
&compressed);
|
||||
break;
|
||||
case rocksdb::kBZip2Compression:
|
||||
ok = port::BZip2_Compress(Options().compression_opts, input.data(),
|
||||
ok = BZip2_Compress(Options().compression_opts, input.data(),
|
||||
input.size(), &compressed);
|
||||
break;
|
||||
case rocksdb::kLZ4Compression:
|
||||
ok = port::LZ4_Compress(Options().compression_opts, input.data(),
|
||||
input.size(), &compressed);
|
||||
ok = LZ4_Compress(Options().compression_opts, input.data(), input.size(),
|
||||
&compressed);
|
||||
break;
|
||||
case rocksdb::kLZ4HCCompression:
|
||||
ok = port::LZ4HC_Compress(Options().compression_opts, input.data(),
|
||||
ok = LZ4HC_Compress(Options().compression_opts, input.data(),
|
||||
input.size(), &compressed);
|
||||
break;
|
||||
default:
|
||||
|
@ -1851,27 +1852,27 @@ class Benchmark {
|
|||
case rocksdb::kSnappyCompression:
|
||||
// allocate here to make comparison fair
|
||||
uncompressed = new char[input.size()];
|
||||
ok = port::Snappy_Uncompress(compressed.data(), compressed.size(),
|
||||
ok = Snappy_Uncompress(compressed.data(), compressed.size(),
|
||||
uncompressed);
|
||||
break;
|
||||
case rocksdb::kZlibCompression:
|
||||
uncompressed = port::Zlib_Uncompress(
|
||||
compressed.data(), compressed.size(), &decompress_size);
|
||||
uncompressed = Zlib_Uncompress(compressed.data(), compressed.size(),
|
||||
&decompress_size);
|
||||
ok = uncompressed != nullptr;
|
||||
break;
|
||||
case rocksdb::kBZip2Compression:
|
||||
uncompressed = port::BZip2_Uncompress(
|
||||
compressed.data(), compressed.size(), &decompress_size);
|
||||
uncompressed = BZip2_Uncompress(compressed.data(), compressed.size(),
|
||||
&decompress_size);
|
||||
ok = uncompressed != nullptr;
|
||||
break;
|
||||
case rocksdb::kLZ4Compression:
|
||||
uncompressed = port::LZ4_Uncompress(
|
||||
compressed.data(), compressed.size(), &decompress_size);
|
||||
uncompressed = LZ4_Uncompress(compressed.data(), compressed.size(),
|
||||
&decompress_size);
|
||||
ok = uncompressed != nullptr;
|
||||
break;
|
||||
case rocksdb::kLZ4HCCompression:
|
||||
uncompressed = port::LZ4_Uncompress(
|
||||
compressed.data(), compressed.size(), &decompress_size);
|
||||
uncompressed = LZ4_Uncompress(compressed.data(), compressed.size(),
|
||||
&decompress_size);
|
||||
ok = uncompressed != nullptr;
|
||||
break;
|
||||
default:
|
||||
|
|
|
@ -42,6 +42,7 @@
|
|||
#include "util/hash_linklist_rep.h"
|
||||
#include "utilities/merge_operators.h"
|
||||
#include "util/logging.h"
|
||||
#include "util/compression.h"
|
||||
#include "util/mutexlock.h"
|
||||
#include "util/rate_limiter.h"
|
||||
#include "util/statistics.h"
|
||||
|
@ -58,31 +59,31 @@ namespace rocksdb {
|
|||
static bool SnappyCompressionSupported(const CompressionOptions& options) {
|
||||
std::string out;
|
||||
Slice in = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
|
||||
return port::Snappy_Compress(options, in.data(), in.size(), &out);
|
||||
return Snappy_Compress(options, in.data(), in.size(), &out);
|
||||
}
|
||||
|
||||
static bool ZlibCompressionSupported(const CompressionOptions& options) {
|
||||
std::string out;
|
||||
Slice in = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
|
||||
return port::Zlib_Compress(options, in.data(), in.size(), &out);
|
||||
return Zlib_Compress(options, in.data(), in.size(), &out);
|
||||
}
|
||||
|
||||
static bool BZip2CompressionSupported(const CompressionOptions& options) {
|
||||
std::string out;
|
||||
Slice in = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
|
||||
return port::BZip2_Compress(options, in.data(), in.size(), &out);
|
||||
return BZip2_Compress(options, in.data(), in.size(), &out);
|
||||
}
|
||||
|
||||
static bool LZ4CompressionSupported(const CompressionOptions &options) {
|
||||
std::string out;
|
||||
Slice in = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
|
||||
return port::LZ4_Compress(options, in.data(), in.size(), &out);
|
||||
return LZ4_Compress(options, in.data(), in.size(), &out);
|
||||
}
|
||||
|
||||
static bool LZ4HCCompressionSupported(const CompressionOptions &options) {
|
||||
std::string out;
|
||||
Slice in = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
|
||||
return port::LZ4HC_Compress(options, in.data(), in.size(), &out);
|
||||
return LZ4HC_Compress(options, in.data(), in.size(), &out);
|
||||
}
|
||||
|
||||
static std::string RandomString(Random* rnd, int len) {
|
||||
|
|
|
@ -40,6 +40,7 @@
|
|||
#include "table/plain_table_factory.h"
|
||||
#include "table/get_context.h"
|
||||
|
||||
#include "util/compression.h"
|
||||
#include "util/random.h"
|
||||
#include "util/statistics.h"
|
||||
#include "util/testharness.h"
|
||||
|
@ -533,8 +534,7 @@ static bool SnappyCompressionSupported() {
|
|||
#ifdef SNAPPY
|
||||
std::string out;
|
||||
Slice in = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
|
||||
return port::Snappy_Compress(Options().compression_opts,
|
||||
in.data(), in.size(),
|
||||
return Snappy_Compress(Options().compression_opts, in.data(), in.size(),
|
||||
&out);
|
||||
#else
|
||||
return false;
|
||||
|
@ -545,9 +545,7 @@ static bool ZlibCompressionSupported() {
|
|||
#ifdef ZLIB
|
||||
std::string out;
|
||||
Slice in = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
|
||||
return port::Zlib_Compress(Options().compression_opts,
|
||||
in.data(), in.size(),
|
||||
&out);
|
||||
return Zlib_Compress(Options().compression_opts, in.data(), in.size(), &out);
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
|
@ -557,9 +555,7 @@ static bool BZip2CompressionSupported() {
|
|||
#ifdef BZIP2
|
||||
std::string out;
|
||||
Slice in = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
|
||||
return port::BZip2_Compress(Options().compression_opts,
|
||||
in.data(), in.size(),
|
||||
&out);
|
||||
return BZip2_Compress(Options().compression_opts, in.data(), in.size(), &out);
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
|
@ -569,8 +565,7 @@ static bool LZ4CompressionSupported() {
|
|||
#ifdef LZ4
|
||||
std::string out;
|
||||
Slice in = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
|
||||
return port::LZ4_Compress(Options().compression_opts, in.data(), in.size(),
|
||||
&out);
|
||||
return LZ4_Compress(Options().compression_opts, in.data(), in.size(), &out);
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
|
@ -580,8 +575,7 @@ static bool LZ4HCCompressionSupported() {
|
|||
#ifdef LZ4
|
||||
std::string out;
|
||||
Slice in = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
|
||||
return port::LZ4HC_Compress(Options().compression_opts, in.data(), in.size(),
|
||||
&out);
|
||||
return LZ4HC_Compress(Options().compression_opts, in.data(), in.size(), &out);
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue