Tracks files that are live or referenced for purposes of maintaining the 'Files' METADATA column.
More...
#include <LiveFileTracker.h>
|
| LiveFileTracker (const TableIdentifier *identifier, SchemaPtr &schema_ptr, const RangeSpec *range, const String &ag_name) |
|
void | change_range (const String &start_row, const String &end_row) |
|
void | update_live (const String &add, std::vector< String > &deletes, uint32_t nextcsid, int64_t total_blocks) |
| Updates the live file set. More...
|
|
void | add_live_noupdate (const String &fname, int64_t total_blocks) |
| Adds a file to the live file set without seting the 'need_update' bit. More...
|
|
void | add_references (const std::vector< String > &filev) |
| Adds a set of files to the referenced file set. More...
|
|
void | remove_references (const std::vector< String > &filev) |
| Decrements the reference count of each file in the given vector. More...
|
|
void | update_files_column () |
| Updates the 'Files' METADATA column if it needs updating. More...
|
|
void | get_file_data (String &file_list, int64_t *block_countp, bool include_blocked) |
| Returns '
' separated list of files, suitable for writing into the 'Files' column of METADATA. More...
|
|
void | get_file_list (String &file_list) |
| Populates string with live files separated by ';'. More...
|
|
void | set_next_csid (uint32_t nid) |
|
Tracks files that are live or referenced for purposes of maintaining the 'Files' METADATA column.
Definition at line 42 of file LiveFileTracker.h.
void Hypertable::LiveFileTracker::add_live_noupdate |
( |
const String & |
fname, |
|
|
int64_t |
total_blocks |
|
) |
| |
|
inline |
Adds a file to the live file set without seting the 'need_update' bit.
- Parameters
-
fname | file to add |
total_blocks | Total number of cell store blocks in access group |
Definition at line 73 of file LiveFileTracker.h.
void LiveFileTracker::add_references |
( |
const std::vector< String > & |
filev | ) |
|
Adds a set of files to the referenced file set.
If they already exist in the referenced file set, then their reference count is incremented.
- Parameters
-
filev | vector of filenames to add reference |
Definition at line 64 of file LiveFileTracker.cc.
void Hypertable::LiveFileTracker::change_range |
( |
const String & |
start_row, |
|
|
const String & |
end_row |
|
) |
| |
|
inline |
void LiveFileTracker::get_file_data |
( |
String & |
file_list, |
|
|
int64_t * |
block_countp, |
|
|
bool |
include_blocked |
|
) |
| |
Returns '
' separated list of files, suitable for writing into the 'Files' column of METADATA.
If include_blocked is set to true, then the files that are currently blocked from GC are included in the list, prefixed by the '#' character
- Parameters
-
file_list | reference to output string to hold file list |
block_countp | address of integer to hold the block count for this AG |
include_blocked | include commented out files blocked from GC |
Definition at line 171 of file LiveFileTracker.cc.
void LiveFileTracker::get_file_list |
( |
String & |
file_list | ) |
|
Populates string with live files separated by ';'.
- Parameters
-
file_list | Output string to hold file list |
Definition at line 192 of file LiveFileTracker.cc.
void LiveFileTracker::remove_references |
( |
const std::vector< String > & |
filev | ) |
|
Decrements the reference count of each file in the given vector.
If the file removed is one that has been written into the 'Files' column as 'blocked', then the m_need_update flag is set to true, indicating the the column needs updating.
If any of the reference counts drop to zero, then the corresponding file is removed from the reference set.
- Parameters
-
filev | vector of filenames to remove reference |
Definition at line 81 of file LiveFileTracker.cc.
void Hypertable::LiveFileTracker::set_next_csid |
( |
uint32_t |
nid | ) |
|
|
inline |
String LiveFileTracker::strip_basename |
( |
const String & |
fname | ) |
|
|
private |
void LiveFileTracker::update_files_column |
( |
| ) |
|
Updates the 'Files' METADATA column if it needs updating.
Definition at line 96 of file LiveFileTracker.cc.
void LiveFileTracker::update_live |
( |
const String & |
add, |
|
|
std::vector< String > & |
deletes, |
|
|
uint32_t |
nextcsid, |
|
|
int64_t |
total_blocks |
|
) |
| |
Updates the live file set.
- Parameters
-
add | filename to add |
deletes | vector of filenames to delete |
nextcsid | Next available CellStore ID |
total_blocks | Total number of cell store blocks in access group |
Definition at line 52 of file LiveFileTracker.cc.
String Hypertable::LiveFileTracker::m_ag_name |
|
private |
std::set<String> Hypertable::LiveFileTracker::m_blocked |
|
private |
uint32_t Hypertable::LiveFileTracker::m_cur_nextcsid |
|
private |
String Hypertable::LiveFileTracker::m_end_row |
|
private |
String Hypertable::LiveFileTracker::m_file_basename |
|
private |
bool Hypertable::LiveFileTracker::m_is_root |
|
private |
uint32_t Hypertable::LiveFileTracker::m_last_nextcsid |
|
private |
std::set<String> Hypertable::LiveFileTracker::m_live |
|
private |
std::mutex Hypertable::LiveFileTracker::m_mutex |
|
private |
bool Hypertable::LiveFileTracker::m_need_update |
|
private |
SchemaPtr Hypertable::LiveFileTracker::m_schema_ptr |
|
private |
String Hypertable::LiveFileTracker::m_start_row |
|
private |
int64_t Hypertable::LiveFileTracker::m_total_blocks |
|
private |
std::mutex Hypertable::LiveFileTracker::m_update_mutex |
|
private |
The documentation for this class was generated from the following files: