41 #include <boost/algorithm/string.hpp>
52 int32_t flags, uint32_t timeout_ms)
53 : m_props(props), m_comm(conn_manager->get_comm()),
54 m_conn_manager(conn_manager), m_hyperspace(hyperspace),
55 m_range_locator(range_locator), m_app_queue(app_queue), m_namemap(namemap),
56 m_name(name), m_flags(flags), m_timeout_ms(timeout_ms), m_stale(true),
71 bool is_index =
false;
74 size_t pos =
m_name.find_last_of(
'/');
75 if (pos == std::string::npos)
79 is_index =
m_name[pos] ==
'^';
112 HT_THROW2F(e.
code(), e,
"Unable to open Hyperspace table file '%s'",
118 if (is_index &&
m_schema->get_version() < 1)
120 "rebuilt (see REBUILD INDEX)");
133 std::lock_guard<std::mutex> lock(
m_mutex);
141 std::lock_guard<std::mutex> lock(
m_mutex);
150 std::lock_guard<std::mutex> lock(
m_mutex);
165 uint32_t flush_interval_ms) {
166 uint32_t timeout = timeout_ms ? timeout_ms :
m_timeout_ms;
172 std::lock_guard<std::mutex> lock(
m_mutex);
176 if (flush_interval_ms) {
185 uint32_t timeout = timeout_ms ? timeout_ms :
m_timeout_ms;
191 std::lock_guard<std::mutex> lock(
m_mutex);
204 std::lock_guard<std::mutex> lock(
m_mutex);
219 std::lock_guard<std::mutex> lock(
m_mutex);
#define HT_THROW2F(_code_, _ex_, _fmt_,...)
TableScannerAsync * create_scanner_async(ResultCallback *cb, const ScanSpec &scan_spec, uint32_t timeout_ms=0, int32_t flags=0)
Creates an asynchronous scanner on this table.
TableScanner * create_scanner(const ScanSpec &scan_spec, uint32_t timeout_ms=0, int32_t flags=0)
Creates a synchronous scanner on this table.
bool has_qualifier_index_table()
returns true if this table has a qualifier index
Hyperspace::SessionPtr m_hyperspace
std::string String
A String is simply a typedef to std::string.
ApplicationQueueInterfacePtr m_app_queue
bool needs_index_table()
returns true if this table requires a index table
std::shared_ptr< RangeLocator > RangeLocatorPtr
Smart pointer to RangeLocator.
Asynchronous table scanner.
NameIdMapperPtr m_namemap
TableIdentifierManaged m_table
void get(TableIdentifierManaged &table_identifier, SchemaPtr &schema)
Get a copy of table identifier and schema atomically.
bool needs_qualifier_index_table()
returns true if this table requires a qualifier index table
A dynamic, resizable and reference counted memory buffer.
Provides the ability to mutate a table in the form of adding and deleting rows and cells...
Wrapper for TableIdentifier providing member storage.
Scan predicate and control specification.
Provides the ability to mutate a table in the form of adding and deleting rows and cells...
A dynamic, resizable memory buffer.
std::shared_ptr< Session > SessionPtr
std::shared_ptr< Properties > PropertiesPtr
Logging routines and macros.
Compatibility Macros for C/C++.
std::shared_ptr< ApplicationQueueInterface > ApplicationQueueInterfacePtr
Smart pointer to ApplicationQueueInterface.
Synchronous table scanner.
void refresh_if_required()
bool has_index_table()
returns true if this table has an index
size_t m_scanner_queue_size
static Schema * new_instance(const std::string &buf)
Creates schema object from XML schema string.
void set_id(const std::string &new_name)
void clear()
Clears the buffer.
std::string m_toplevel_dir
RangeLocatorPtr m_range_locator
uint8_t * base
Pointer to the allocated memory buffer.
This is a generic exception class for Hypertable.
A String class based on std::string.
std::mutex m_mutex
Mutex for serializing member access.
std::shared_ptr< Schema > SchemaPtr
Smart pointer to Schema.
Declarations for ApplicationQueue.
TableMutatorAsync * create_mutator_async(ResultCallback *cb, uint32_t timeout_ms=0, uint32_t flags=0)
Creates an asynchronous mutator on this table.
std::shared_ptr< ConnectionManager > ConnectionManagerPtr
Smart pointer to ConnectionManager.
TableMutator * create_mutator(uint32_t timeout_ms=0, uint32_t flags=0, uint32_t flush_interval_ms=0)
Creates a mutator on this table.
A TableMutator that can be shared from multiple threads and incidentally has an option to do periodic...
Table(PropertiesPtr &, RangeLocatorPtr &, ConnectionManagerPtr &, Hyperspace::SessionPtr &, ApplicationQueueInterfacePtr &, NameIdMapperPtr &, const std::string &name, int32_t flags=0, uint32_t default_timeout_ms=0)
Represents an open table.
std::shared_ptr< NameIdMapper > NameIdMapperPtr
Smart pointer to NameIdMapper.
Error codes, Exception handling, error logging.
#define HT_THROW(_code_, _msg_)
void refresh()
Refresh schema etc.
int code() const
Returns the error code.
#define HT_THROW2(_code_, _ex_, _msg_)