]>
git.proxmox.com Git - ceph.git/blob - ceph/src/rocksdb/table/block_based/reader_common.h
1 // Copyright (c) 2011-present, Facebook, Inc. All rights reserved.
2 // This source code is licensed under both the GPLv2 (found in the
3 // COPYING file in the root directory) and Apache 2.0 License
4 // (found in the LICENSE.Apache file in the root directory).
6 // Copyright (c) 2011 The LevelDB Authors. All rights reserved.
7 // Use of this source code is governed by a BSD-style license that can be
8 // found in the LICENSE file. See the AUTHORS file for names of contributors.
11 #include "rocksdb/cache.h"
12 #include "rocksdb/table.h"
14 namespace ROCKSDB_NAMESPACE
{
15 // Release the cached entry and decrement its ref count.
16 extern void ForceReleaseCachedEntry(void* arg
, void* h
);
18 inline MemoryAllocator
* GetMemoryAllocator(
19 const BlockBasedTableOptions
& table_options
) {
20 return table_options
.block_cache
.get()
21 ? table_options
.block_cache
->memory_allocator()
25 inline MemoryAllocator
* GetMemoryAllocatorForCompressedBlock(
26 const BlockBasedTableOptions
& table_options
) {
27 return table_options
.block_cache_compressed
.get()
28 ? table_options
.block_cache_compressed
->memory_allocator()
32 // Assumes block has a trailer as in format.h. file_name and offset provided
33 // for generating a diagnostic message in returned status.
34 extern Status
VerifyBlockChecksum(ChecksumType type
, const char* data
,
36 const std::string
& file_name
,
38 } // namespace ROCKSDB_NAMESPACE