#include <CellStoreV6.h>
Classes | |
class | IndexBuilder |
Public Member Functions | |
CellStoreV6 (Filesystem *filesys) | |
CellStoreV6 (Filesystem *filesys, SchemaPtr &schema) | |
virtual | ~CellStoreV6 () |
void | create (const char *fname, size_t max_entries, PropertiesPtr &props, const TableIdentifier *table_id=0) override |
Creates a new cell store. More... | |
void | add (const Key &key, const ByteString value) override |
Inserts a key/value pair into the cell list. More... | |
void | finalize (TableIdentifier *table_identifier) override |
Finalizes the creation of a cell store, by writing block index and metadata trailer. More... | |
void | open (const String &fname, const String &start_row, const String &end_row, int32_t fd, int64_t file_length, CellStoreTrailer *trailer) override |
Opens a cell store with possibly a restricted view. More... | |
void | rescope (const String &start_row, const String &end_row) override |
int64_t | get_blocksize () override |
Returns the block size used for this cell store. More... | |
bool | may_contain (ScanContext *scan_ctx) override |
Bloom filter lookup. More... | |
uint64_t | disk_usage () override |
Returns the disk used by this cell store. More... | |
float | compression_ratio () override |
Returns block compression ratio of this cell store. More... | |
void | split_row_estimate_data (SplitRowDataMapT &split_row_data) override |
Populates split_row_data with unique row and count estimates from block index. More... | |
void | populate_index_pseudo_table_scanner (CellListScannerBuffer *scanner) override |
Populates scanner with key/value pairs generated from CellStore index. More... | |
int64_t | get_total_entries () override |
Returns the number of key/value pairs in the cell store. More... | |
std::string & | get_filename () override |
Pathname of cell store file. More... | |
int | get_file_id () override |
Returns a unique identifier which identifies the underlying file for caching purposes. More... | |
CellListScannerPtr | create_scanner (ScanContext *scan_ctx) override |
Creates a scanner on this cell list. More... | |
BlockCompressionCodec * | create_block_compression_codec () override |
Creates a block compression codec suitable for decompressing the cell store's blocks. More... | |
KeyDecompressor * | create_key_decompressor () override |
Creates a key decompressor suitable for decompressing the keys stored in this cell store. More... | |
void | display_block_info () override |
Displays block information to stdout. More... | |
int64_t | end_of_last_block () override |
Returns the offset of the end of the last block in the cell store. More... | |
size_t | bloom_filter_size () override |
Return Bloom filter size. More... | |
int64_t | bloom_filter_memory_used () override |
Returns the amount of memory consumed by the bloom filter. More... | |
int64_t | block_index_memory_used () override |
Returns the amount of memory consumed by the block index. More... | |
uint64_t | purge_indexes () override |
Purges bloom filter and block indexes. More... | |
bool | restricted_range () override |
Returns true if the cellstore was opened with a restricted range. More... | |
const std::vector< String > & | get_replaced_files () override |
Returns all the cell store files replaced by this CellStore. More... | |
int32_t | get_fd () override |
Returns the open file descriptor for the CellStore file. More... | |
int32_t | reopen_fd () override |
Closes and reopens the underlying CellStore file. More... | |
CellStoreTrailer * | get_trailer () override |
Return a pointer to the trailer object for this cell store. More... | |
uint16_t | block_header_format () override |
Public Member Functions inherited from Hypertable::CellStore | |
CellStore () | |
virtual | ~CellStore () |
virtual size_t | block_count () |
Returns the number of CellStore blocks covered by this object. More... | |
virtual void | set_replaced_files (const std::vector< String > &old_files) |
Sets the cell store files replaced by this CellStore. More... | |
virtual void | get_index_memory_stats (IndexMemoryStats *statsp) |
Returns amount of purgeable index memory available. More... | |
uint64_t | bytes_read () |
Returns the number of "uncompressed" bytes read from the underlying filesystem. More... | |
void | decrement_index_refcount () |
Decrement index reference count. More... | |
Public Member Functions inherited from Hypertable::CellList | |
virtual | ~CellList () |
virtual const char * | get_start_row () |
Returns the start row of this cell list. More... | |
virtual const char * | get_end_row () |
Returns the end row of this cell list. More... | |
Protected Types | |
typedef BlobHashSet | BloomFilterItems |
Protected Member Functions | |
void | create_bloom_filter (bool is_approx=false) |
void | load_bloom_filter () |
void | load_block_index () |
void | load_replaced_files () |
Additional Inherited Members | |
Public Types inherited from Hypertable::CellList | |
typedef std::pair< const char *, int64_t > | SplitRowDataValue |
typedef StlAllocator < SplitRowDataValue > | SplitRowDataAlloc |
typedef std::map< const char *, int64_t, LtCstr, SplitRowDataAlloc > | SplitRowDataMapT |
Static Public Attributes inherited from Hypertable::CellStore | |
static const char | DATA_BLOCK_MAGIC [10] |
static const char | INDEX_FIXED_BLOCK_MAGIC [10] |
static const char | INDEX_VARIABLE_BLOCK_MAGIC [10] |
Definition at line 65 of file CellStoreV6.h.
|
protected |
Definition at line 164 of file CellStoreV6.h.
CellStoreV6::CellStoreV6 | ( | Filesystem * | filesys | ) |
Definition at line 69 of file CellStoreV6.cc.
CellStoreV6::CellStoreV6 | ( | Filesystem * | filesys, |
SchemaPtr & | schema | ||
) |
Definition at line 75 of file CellStoreV6.cc.
|
virtual |
Definition at line 81 of file CellStoreV6.cc.
|
overridevirtual |
Inserts a key/value pair into the cell list.
key | key object |
value | ByteString representing value |
Implements Hypertable::CellStore.
Definition at line 446 of file CellStoreV6.cc.
|
overridevirtual |
Implements Hypertable::CellStore.
Definition at line 1096 of file CellStoreV6.cc.
|
inlineoverridevirtual |
Returns the amount of memory consumed by the block index.
Implements Hypertable::CellStore.
Definition at line 132 of file CellStoreV6.h.
|
inlineoverridevirtual |
Returns the amount of memory consumed by the bloom filter.
Implements Hypertable::CellStore.
Definition at line 127 of file CellStoreV6.h.
|
inlineoverridevirtual |
Return Bloom filter size.
Implements Hypertable::CellStore.
Definition at line 122 of file CellStoreV6.h.
|
inlineoverridevirtual |
Returns block compression ratio of this cell store.
Implements Hypertable::CellStore.
Definition at line 99 of file CellStoreV6.h.
|
overridevirtual |
Creates a new cell store.
fname | name of file to contain the cell store |
max_entries | maximum number of entries the cell store is expected to have |
props | cellstore specific properties |
table_id | Table identifier |
Implements Hypertable::CellStore.
Definition at line 179 of file CellStoreV6.cc.
|
overridevirtual |
Creates a block compression codec suitable for decompressing the cell store's blocks.
Implements Hypertable::CellStore.
Definition at line 99 of file CellStoreV6.cc.
|
protected |
Definition at line 274 of file CellStoreV6.cc.
|
overridevirtual |
Creates a key decompressor suitable for decompressing the keys stored in this cell store.
Reimplemented from Hypertable::CellStore.
Definition at line 104 of file CellStoreV6.cc.
|
overridevirtual |
Creates a scanner on this cell list.
scan_ctx | smart pointer to scan context |
Reimplemented from Hypertable::CellStore.
Definition at line 143 of file CellStoreV6.cc.
|
inlineoverridevirtual |
Returns the disk used by this cell store.
If the cell store is opened with a restricted range, then it returns an estimate of the disk used by that range.
Implements Hypertable::CellStore.
Definition at line 98 of file CellStoreV6.h.
|
overridevirtual |
Displays block information to stdout.
Implements Hypertable::CellStore.
Definition at line 1085 of file CellStoreV6.cc.
|
inlineoverridevirtual |
Returns the offset of the end of the last block in the cell store.
Implements Hypertable::CellStore.
Definition at line 120 of file CellStoreV6.h.
|
overridevirtual |
Finalizes the creation of a cell store, by writing block index and metadata trailer.
table_identifier | table identifier |
Chop the Index buffers down to the exact length
Write fixed index
Write variable index
Set up index
close file for writing
Set file length
Re-open file for reading
Implements Hypertable::CellStore.
Definition at line 557 of file CellStoreV6.cc.
|
inlineoverridevirtual |
Returns the block size used for this cell store.
The block size is the amount of uncompressed key/value pairs to collect before compressing and storing as a compressed block in the cell store.
Implements Hypertable::CellStore.
Definition at line 96 of file CellStoreV6.h.
|
inlineoverridevirtual |
Returns the open file descriptor for the CellStore file.
Implements Hypertable::CellStore.
Definition at line 141 of file CellStoreV6.h.
|
inlineoverridevirtual |
Returns a unique identifier which identifies the underlying file for caching purposes.
Implements Hypertable::CellStore.
Definition at line 115 of file CellStoreV6.h.
|
inlineoverridevirtual |
Pathname of cell store file.
Implements Hypertable::CellStore.
Definition at line 114 of file CellStoreV6.h.
|
overridevirtual |
Returns all the cell store files replaced by this CellStore.
Reimplemented from Hypertable::CellStore.
Definition at line 305 of file CellStoreV6.cc.
|
inlineoverridevirtual |
Returns the number of key/value pairs in the cell store.
Implements Hypertable::CellStore.
Definition at line 113 of file CellStoreV6.h.
|
inlineoverridevirtual |
Return a pointer to the trailer object for this cell store.
Implements Hypertable::CellStore.
Definition at line 154 of file CellStoreV6.h.
|
protected |
Read index data
inflate fixed index
inflate variable index
Set up index
Definition at line 932 of file CellStoreV6.cc.
|
protected |
Definition at line 359 of file CellStoreV6.cc.
|
protected |
|
overridevirtual |
Bloom filter lookup.
scan_ctx | Scan context |
scan_ctx
Implements Hypertable::CellStore.
Definition at line 1030 of file CellStoreV6.cc.
|
overridevirtual |
Opens a cell store with possibly a restricted view.
When a range splits, the cell stores that comprise the range get shared between the two newly created ranges. This method allows each of the two ranges to open the same cell store but view different portions of it.
fname | pathname of file containing cell store |
start_row | restricts view of this store to key/value pairs that are greater than this value |
end_row | restricts view of this store to key/value pairs that are less than or equal to this value |
fd | cell store file descriptor |
file_length | length of cell store file |
trailer | pointer to trailer object |
Sanity check trailer
Implements Hypertable::CellStore.
Definition at line 862 of file CellStoreV6.cc.
|
overridevirtual |
Populates scanner
with key/value pairs generated from CellStore index.
This method will first load the CellStore block index into memory, if it is not already loaded, and then it will call the CellStoreBlockIndexArray::populate_pseudo_table_scanner method to populate scanner
with synthesized .cellstore.index pseudo-table cells.
scanner | Pointer to CellListScannerBuffer to receive key/value pairs |
Reimplemented from Hypertable::CellStore.
Definition at line 123 of file CellStoreV6.cc.
|
overridevirtual |
Purges bloom filter and block indexes.
Implements Hypertable::CellStore.
Definition at line 416 of file CellStoreV6.cc.
|
inlineoverridevirtual |
Closes and reopens the underlying CellStore file.
Implements Hypertable::CellStore.
Definition at line 146 of file CellStoreV6.h.
Reimplemented from Hypertable::CellStore.
Definition at line 900 of file CellStoreV6.cc.
|
inlineoverridevirtual |
Returns true if the cellstore was opened with a restricted range.
Implements Hypertable::CellStore.
Definition at line 138 of file CellStoreV6.h.
|
overridevirtual |
Populates split_row_data
with unique row and count estimates from block index.
split_row_data | Reference to accumulator map holding unique rows and counts taken from block index. |
split_row_data
should not be cleared Reimplemented from Hypertable::CellStore.
Definition at line 108 of file CellStoreV6.cc.
|
protected |
Definition at line 170 of file CellStoreV6.h.
|
protected |
Definition at line 189 of file CellStoreV6.h.
|
protected |
Bloom filter.
Definition at line 199 of file CellStoreV6.h.
|
protected |
Definition at line 187 of file CellStoreV6.h.
|
protected |
Definition at line 186 of file CellStoreV6.h.
|
protected |
Definition at line 173 of file CellStoreV6.h.
|
protected |
Definition at line 193 of file CellStoreV6.h.
|
protected |
Definition at line 182 of file CellStoreV6.h.
|
protected |
Definition at line 172 of file CellStoreV6.h.
|
protected |
Definition at line 184 of file CellStoreV6.h.
|
protected |
Definition at line 179 of file CellStoreV6.h.
|
protected |
Definition at line 168 of file CellStoreV6.h.
|
protected |
Definition at line 180 of file CellStoreV6.h.
|
protected |
Definition at line 178 of file CellStoreV6.h.
|
protected |
Definition at line 169 of file CellStoreV6.h.
|
protected |
Definition at line 166 of file CellStoreV6.h.
|
protected |
Definition at line 190 of file CellStoreV6.h.
|
protected |
Definition at line 174 of file CellStoreV6.h.
|
protected |
32-bit block index
Definition at line 202 of file CellStoreV6.h.
|
protected |
64-bit block index
Definition at line 205 of file CellStoreV6.h.
|
protected |
Definition at line 191 of file CellStoreV6.h.
|
protected |
Definition at line 188 of file CellStoreV6.h.
|
protected |
Definition at line 185 of file CellStoreV6.h.
|
protected |
Definition at line 177 of file CellStoreV6.h.
|
protected |
Definition at line 176 of file CellStoreV6.h.
|
protected |
Definition at line 194 of file CellStoreV6.h.
|
protected |
Definition at line 192 of file CellStoreV6.h.
|
protected |
Definition at line 167 of file CellStoreV6.h.
|
protected |
Definition at line 175 of file CellStoreV6.h.
|
protected |
Definition at line 171 of file CellStoreV6.h.
|
protected |
Definition at line 183 of file CellStoreV6.h.
|
protected |
Definition at line 181 of file CellStoreV6.h.