fix unused param `allocator` in compression.h (#4453)

Summary:
this should fix currently failing contrun test: rocksdb-contrun-no_compression, rocksdb-contrun-tsan, rocksdb-contrun-tsan_crash
Pull Request resolved: https://github.com/facebook/rocksdb/pull/4453

Differential Revision: D10202626

Pulled By: miasantreble

fbshipit-source-id: 850b07f14f671b5998c22d8239e2a55b2fc1e355
main
Zhongyi Xie 6 years ago committed by Facebook Github Bot
parent a1f6142f38
commit ce1fc5af09
  1. 8
      db/version_set.cc
  2. 1
      include/rocksdb/cache.h
  3. 17
      table/block_based_table_reader.cc
  4. 3
      table/format.cc
  5. 2
      table/format.h
  6. 2
      util/compression.h

@ -16,12 +16,12 @@
#include <inttypes.h> #include <inttypes.h>
#include <stdio.h> #include <stdio.h>
#include <algorithm> #include <algorithm>
#include <list>
#include <map> #include <map>
#include <set> #include <set>
#include <string> #include <string>
#include <unordered_map> #include <unordered_map>
#include <vector> #include <vector>
#include <list>
#include "db/compaction.h" #include "db/compaction.h"
#include "db/internal_stats.h" #include "db/internal_stats.h"
#include "db/log_reader.h" #include "db/log_reader.h"
@ -2069,7 +2069,8 @@ void VersionStorageInfo::GetOverlappingInputs(
if (begin != nullptr && user_cmp->Compare(file_limit, user_begin) < 0) { if (begin != nullptr && user_cmp->Compare(file_limit, user_begin) < 0) {
// "f" is completely before specified range; skip it // "f" is completely before specified range; skip it
iter++; iter++;
} else if (end != nullptr && user_cmp->Compare(file_start, user_end) > 0) { } else if (end != nullptr &&
user_cmp->Compare(file_start, user_end) > 0) {
// "f" is completely after specified range; skip it // "f" is completely after specified range; skip it
iter++; iter++;
} else { } else {
@ -2087,8 +2088,7 @@ void VersionStorageInfo::GetOverlappingInputs(
user_cmp->Compare(file_start, user_begin) < 0) { user_cmp->Compare(file_start, user_begin) < 0) {
user_begin = file_start; user_begin = file_start;
} }
if (end != nullptr && if (end != nullptr && user_cmp->Compare(file_limit, user_end) > 0) {
user_cmp->Compare(file_limit, user_end) > 0) {
user_end = file_limit; user_end = file_limit;
} }
} }

@ -99,7 +99,6 @@ extern std::shared_ptr<Cache> NewClockCache(size_t capacity,
int num_shard_bits = -1, int num_shard_bits = -1,
bool strict_capacity_limit = false); bool strict_capacity_limit = false);
class Cache { class Cache {
public: public:
// Depending on implementation, cache entries with high priority could be less // Depending on implementation, cache entries with high priority could be less

@ -1102,7 +1102,7 @@ Status BlockBasedTable::Open(const ImmutableCFOptions& ioptions,
if (tail_prefetch_stats != nullptr) { if (tail_prefetch_stats != nullptr) {
assert(prefetch_buffer->min_offset_read() < file_size); assert(prefetch_buffer->min_offset_read() < file_size);
tail_prefetch_stats->RecordEffectiveSize( tail_prefetch_stats->RecordEffectiveSize(
static_cast<size_t>(file_size) - prefetch_buffer->min_offset_read()); static_cast<size_t>(file_size) - prefetch_buffer->min_offset_read());
} }
*table_reader = std::move(new_table); *table_reader = std::move(new_table);
} }
@ -1158,8 +1158,7 @@ Status BlockBasedTable::ReadMetaBlock(Rep* rep,
rep->footer.metaindex_handle(), &meta, rep->ioptions, rep->footer.metaindex_handle(), &meta, rep->ioptions,
true /* decompress */, Slice() /*compression dict*/, true /* decompress */, Slice() /*compression dict*/,
rep->persistent_cache_options, kDisableGlobalSequenceNumber, rep->persistent_cache_options, kDisableGlobalSequenceNumber,
0 /* read_amp_bytes_per_bit */, 0 /* read_amp_bytes_per_bit */, GetCacheAllocator(rep->table_options));
GetCacheAllocator(rep->table_options));
if (!s.ok()) { if (!s.ok()) {
ROCKS_LOG_ERROR(rep->ioptions.info_log, ROCKS_LOG_ERROR(rep->ioptions.info_log,
@ -1712,8 +1711,7 @@ TBlockIter* BlockBasedTable::NewDataBlockIterator(
compression_dict, rep->persistent_cache_options, compression_dict, rep->persistent_cache_options,
is_index ? kDisableGlobalSequenceNumber : rep->global_seqno, is_index ? kDisableGlobalSequenceNumber : rep->global_seqno,
rep->table_options.read_amp_bytes_per_bit, rep->table_options.read_amp_bytes_per_bit,
GetCacheAllocator(rep->table_options), GetCacheAllocator(rep->table_options), rep->immortal_table);
rep->immortal_table);
} }
if (s.ok()) { if (s.ok()) {
block.value = block_value.release(); block.value = block_value.release();
@ -1819,8 +1817,7 @@ Status BlockBasedTable::MaybeLoadDataBlockToCache(
compression_dict, rep->persistent_cache_options, compression_dict, rep->persistent_cache_options,
is_index ? kDisableGlobalSequenceNumber : rep->global_seqno, is_index ? kDisableGlobalSequenceNumber : rep->global_seqno,
rep->table_options.read_amp_bytes_per_bit, rep->table_options.read_amp_bytes_per_bit,
GetCacheAllocator(rep->table_options), GetCacheAllocator(rep->table_options), rep->immortal_table);
rep->immortal_table);
} }
if (s.ok()) { if (s.ok()) {
@ -2544,8 +2541,7 @@ Status BlockBasedTable::VerifyChecksumInBlocks(
rep_->file.get(), nullptr /* prefetch buffer */, rep_->footer, rep_->file.get(), nullptr /* prefetch buffer */, rep_->footer,
ReadOptions(), handle, &contents, rep_->ioptions, ReadOptions(), handle, &contents, rep_->ioptions,
false /* decompress */, dummy_comp_dict /*compression dict*/, false /* decompress */, dummy_comp_dict /*compression dict*/,
rep_->persistent_cache_options, rep_->persistent_cache_options, GetCacheAllocator(rep_->table_options));
GetCacheAllocator(rep_->table_options));
s = block_fetcher.ReadBlockContents(); s = block_fetcher.ReadBlockContents();
if (!s.ok()) { if (!s.ok()) {
break; break;
@ -2571,8 +2567,7 @@ Status BlockBasedTable::VerifyChecksumInBlocks(
rep_->file.get(), nullptr /* prefetch buffer */, rep_->footer, rep_->file.get(), nullptr /* prefetch buffer */, rep_->footer,
ReadOptions(), handle, &contents, rep_->ioptions, ReadOptions(), handle, &contents, rep_->ioptions,
false /* decompress */, dummy_comp_dict /*compression dict*/, false /* decompress */, dummy_comp_dict /*compression dict*/,
rep_->persistent_cache_options, rep_->persistent_cache_options, GetCacheAllocator(rep_->table_options));
GetCacheAllocator(rep_->table_options));
s = block_fetcher.ReadBlockContents(); s = block_fetcher.ReadBlockContents();
if (!s.ok()) { if (!s.ok()) {
break; break;

@ -280,8 +280,7 @@ Status ReadFooterFromFile(RandomAccessFileReader* file,
Status UncompressBlockContentsForCompressionType( Status UncompressBlockContentsForCompressionType(
const UncompressionContext& uncompression_ctx, const char* data, size_t n, const UncompressionContext& uncompression_ctx, const char* data, size_t n,
BlockContents* contents, uint32_t format_version, BlockContents* contents, uint32_t format_version,
const ImmutableCFOptions& ioptions, const ImmutableCFOptions& ioptions, CacheAllocator* allocator) {
CacheAllocator* allocator) {
CacheAllocationPtr ubuf; CacheAllocationPtr ubuf;
assert(uncompression_ctx.type() != kNoCompression && assert(uncompression_ctx.type() != kNoCompression &&

@ -25,8 +25,8 @@
#include "options/cf_options.h" #include "options/cf_options.h"
#include "port/port.h" // noexcept #include "port/port.h" // noexcept
#include "table/persistent_cache_options.h" #include "table/persistent_cache_options.h"
#include "util/file_reader_writer.h"
#include "util/cache_allocator.h" #include "util/cache_allocator.h"
#include "util/file_reader_writer.h"
namespace rocksdb { namespace rocksdb {

@ -589,6 +589,7 @@ inline CacheAllocationPtr Zlib_Uncompress(
(void)input_length; (void)input_length;
(void)decompress_size; (void)decompress_size;
(void)compress_format_version; (void)compress_format_version;
(void)allocator;
(void)windowBits; (void)windowBits;
return nullptr; return nullptr;
#endif #endif
@ -733,6 +734,7 @@ inline CacheAllocationPtr BZip2_Uncompress(
(void)input_length; (void)input_length;
(void)decompress_size; (void)decompress_size;
(void)compress_format_version; (void)compress_format_version;
(void)allocator;
return nullptr; return nullptr;
#endif #endif
} }

Loading…
Cancel
Save