Comments for BlockBasedTable
Summary: Pull Request resolved: https://github.com/facebook/rocksdb/pull/5352 Differential Revision: D15498477 Pulled By: vjnadimpalli fbshipit-source-id: 08a981521848433362a56ac521c7fb83c7dd7b2a
This commit is contained in:
parent
f69e63dc5f
commit
f66026c8c7
@ -59,9 +59,17 @@ class GetContext;
|
||||
|
||||
typedef std::vector<std::pair<std::string, std::string>> KVPairBlock;
|
||||
|
||||
// A Table is a sorted map from strings to strings. Tables are
|
||||
// immutable and persistent. A Table may be safely accessed from
|
||||
// multiple threads without external synchronization.
|
||||
// Reader class for BlockBasedTable format.
|
||||
// For the format of BlockBasedTable refer to
|
||||
// https://github.com/facebook/rocksdb/wiki/Rocksdb-BlockBasedTable-Format.
|
||||
// This is the default table type. Data is chucked into fixed size blocks and
|
||||
// each block in-turn stores entries. When storing data, we can compress and/or
|
||||
// encode data efficiently within a block, which often results in a much smaller
|
||||
// data size compared with the raw data size. As for the record retrieval, we'll
|
||||
// first locate the block where target record may reside, then read the block to
|
||||
// memory, and finally search that record within the block. Of course, to avoid
|
||||
// frequent reads of the same block, we introduced the block cache to keep the
|
||||
// loaded blocks in the memory.
|
||||
class BlockBasedTable : public TableReader {
|
||||
public:
|
||||
static const std::string kFilterBlockPrefix;
|
||||
@ -425,7 +433,7 @@ class BlockBasedTable : public TableReader {
|
||||
friend class PartitionedFilterBlockTest;
|
||||
};
|
||||
|
||||
// Maitaning state of a two-level iteration on a partitioned index structure
|
||||
// Maitaning state of a two-level iteration on a partitioned index structure.
|
||||
class BlockBasedTable::PartitionedIndexIteratorState
|
||||
: public TwoLevelIteratorState {
|
||||
public:
|
||||
@ -444,6 +452,8 @@ class BlockBasedTable::PartitionedIndexIteratorState
|
||||
bool index_key_is_full_;
|
||||
};
|
||||
|
||||
// Stores all the properties associated with a BlockBasedTable.
|
||||
// These are immutable.
|
||||
struct BlockBasedTable::Rep {
|
||||
Rep(const ImmutableCFOptions& _ioptions, const EnvOptions& _env_options,
|
||||
const BlockBasedTableOptions& _table_opt,
|
||||
@ -553,6 +563,7 @@ struct BlockBasedTable::Rep {
|
||||
}
|
||||
};
|
||||
|
||||
// Iterates over the contents of BlockBasedTable.
|
||||
template <class TBlockIter, typename TValue = Slice>
|
||||
class BlockBasedTableIterator : public InternalIteratorBase<TValue> {
|
||||
public:
|
||||
|
@ -26,9 +26,11 @@ struct TableProperties;
|
||||
class GetContext;
|
||||
class MultiGetContext;
|
||||
|
||||
// A Table is a sorted map from strings to strings. Tables are
|
||||
// immutable and persistent. A Table may be safely accessed from
|
||||
// multiple threads without external synchronization.
|
||||
// A Table (also referred to as SST) is a sorted map from strings to strings.
|
||||
// Tables are immutable and persistent. A Table may be safely accessed from
|
||||
// multiple threads without external synchronization. Table readers are used
|
||||
// for reading various types of table formats supported by rocksdb including
|
||||
// BlockBasedTable, PlainTable and CuckooTable format.
|
||||
class TableReader {
|
||||
public:
|
||||
virtual ~TableReader() {}
|
||||
|
Loading…
Reference in New Issue
Block a user