27 #ifndef Hypertable_RangeServer_TableInfo_h
28 #define Hypertable_RangeServer_TableInfo_h
42 #include <condition_variable>
77 template<
typename Func>
79 std::vector<RangeData> stripped;
80 stripped.reserve(
array.size());
81 remove_copy_if(
array.begin(),
array.end(), back_inserter(stripped), pred);
100 : start_row(start_row), end_row(end_row) { }
137 virtual bool remove(
const String &start_row,
const String &end_row);
148 const String &new_end_row);
164 std::lock_guard<std::mutex> lock(
m_mutex);
172 std::lock_guard<std::mutex> lock(
m_mutex);
179 std::lock_guard<std::mutex> lock(
m_mutex);
318 #endif // Hypertable_RangeServer_TableInfo_h
void remove_if(Func pred)
Template function for removing ranges that satisfy a predicate.
bool remove_range(const RangeSpec &range_spec, RangePtr &range)
Removes the range specified by the given RangeSpec from the active set.
RangePtr range
Smart pointer to Range object.
RangeData(RangePtr r, Range::MaintenanceData *md=0)
Constructor.
void stage_range(const RangeSpec &range_spec, std::chrono::fast_clock::time_point deadline)
Stages a range to being added.
void clear()
Clears the active range set.
bool has_range(const RangeSpec &range_spec)
Checks if range corresponding to the given RangeSpec exists in the active set.
virtual void change_end_row(const String &start_row, const String &old_end_row, const String &new_end_row)
Changes the end row of a range in the active set.
Holds set of range objects for a table.
std::string String
A String is simply a typedef to std::string.
chrono::time_point< fast_clock > time_point
Declarations for TableIdentifier and TableIdentifierManaged.
void set_maintenance_disabled(bool val)
Sets the maintenance disabled flag.
std::condition_variable m_cond
Condition variable signalled on m_staged_set change.
void update_schema(SchemaPtr &schema)
Updates schema, propagating change to all ranges in active set.
Interface for removing a range or changing its end row in a Range set.
String end_row
Cached end row of range.
std::set< RangeInfo > m_active_set
Set of active ranges.
Wrapper for TableIdentifier providing member storage.
bool find_containing_range(const String &row, RangePtr &range, String &start_row, String &end_row)
Finds the range to which the given row belongs.
void get_ranges(Ranges &ranges)
Fills Ranges vector with ranges from the active set.
std::set< RangeInfo > m_staged_set
Set of staged ranges (soon to become active)
bool m_maintenance_disabled
Flag indicating if maintenance is disabled for table.
ByteArena arena
Memory arena.
std::vector< RangeData > array
Vector of RangeData objects.
TableIdentifier & identifier()
Returns a reference to the table identifier.
RangeInfo(const String &start_row, const String &end_row)
Constructor.
bool maintenance_disabled()
Checks if maintenance has been disabled for this table.
TableInfo(const TableIdentifier *identifier, SchemaPtr &schema, bool maintenance_disabled)
Constructor.
bool get_range(const RangeSpec &range_spec, RangePtr &range)
Returns range object corresponding to the given RangeSpec.
void add_range(RangePtr &range, bool remove_if_exists=false)
Adds a range to the active set.
void promote_staged_range(RangePtr &range)
Promotes a range from the staged set to the active set.
Declarations for RangeSpec and RangeSpecManaged.
Holds pointer to range and cached start and end rows.
SchemaPtr get_schema()
Returns a pointer to the schema object.
bool operator<(const directory_entry< _Key, _Tp > &lhs, const directory_entry< _Key, _Tp > &rhs)
size_t get_range_count()
Returns the number of ranges in the active set.
void unstage_range(const RangeSpec &range_spec)
Unstages a previously staged range.
std::shared_ptr< TableInfo > TableInfoPtr
Smart pointer to TableInfo.
bool includes_row(const String &row) const
Checks to see if a given row belongs to any of the ranges in the active set.
std::shared_ptr< Range > RangePtr
Smart pointer to Range.
String start_row
Cached start row of range.
Declarations for MasterClient This file contains declarations for MasterClient, a client interface cl...
std::shared_ptr< Schema > SchemaPtr
Smart pointer to Schema.
virtual void change_start_row(const String &old_start_row, const String &new_start_row, const String &end_row)
Changes the start row of a range in the active set.
TableIdentifierManaged m_identifier
Table identifier
std::mutex m_mutex
Mutex for serializing member access
String extensions and helpers: sets, maps, append operators etc.
Holds pointers to a Range and associated Range::MaintenanceData.
Range::MaintenanceData * data
Pointer to maintenance data for range.
SchemaPtr m_schema
Table schema object
virtual ~TableInfo()
Destructor.
Holds vector of RangeData objects and memory arena.
RangePtr range
Pointer to Range.
std::shared_ptr< Ranges > RangesPtr
Smart pointer to Ranges.