50 const String &error_msg,
bool eos) { }
58 : m_index_mutator(0), m_qualifier_index_mutator(0) {
62 if (qualifier_index_table)
67 for (
auto cf_spec : primary_schema->get_column_families()) {
68 if (!cf_spec || cf_spec->get_deleted())
70 if (cf_spec->get_value_index())
72 if (cf_spec->get_qualifier_index())
79 const uint8_t *vptr = value.
ptr;
94 value_index_mutator, qualifier_index_mutator);
106 const uint8_t *vptr = value.
ptr;
120 value_index_mutator, qualifier_index_mutator);
126 SchemaPtr &schema,
bool has_index,
bool has_qualifier_index)
131 HT_ASSERT(has_index || has_qualifier_index);
138 if (has_qualifier_index)
141 if ((has_index && index_table)
142 && (has_qualifier_index && qualifier_index_table)) {
143 return std::make_shared<IndexUpdater>(schema, index_table,
144 qualifier_index_table);
152 if (!
ms_namemap->id_to_name(table_id, table_name)) {
153 HT_WARNF(
"Failed to map table id %s to table name", table_id.c_str());
157 if (has_index && !index_table) {
160 String indexname = dir !=
"."
168 if (has_qualifier_index && !qualifier_index_table) {
171 String indexname = dir !=
"."
174 qualifier_index_table =
load_table(indexname);
179 if (index_table || qualifier_index_table)
180 return std::make_shared<IndexUpdater>(schema, index_table,
181 qualifier_index_table);
static std::mutex ms_mutex
#define HT_WARNF(msg,...)
void purge(const Key &key, const ByteString &value)
Purges a key from index tables.
Abstract base class for a filesystem.
PropertiesPtr properties
This singleton map stores all options.
std::string String
A String is simply a typedef to std::string.
static ConnectionManagerPtr conn_manager
static const uint32_t FLAG_INSERT
Asynchronous table scanner.
std::shared_ptr< IndexUpdater > IndexUpdaterPtr
Smart pointer to IndexUpdater.
static void clear_cache()
Clears both value and qualifier caches.
virtual void scan_ok(TableScannerAsync *scanner, ScanCellsPtr &cells)
Callback method for successful scan.
static TableMap ms_qualifier_index_cache
virtual void update_ok(TableMutatorAsync *mutator)
Callback method for successful update.
static void close()
Cleanup function; called before leaving main()
void add(const Key &key, uint8_t flag, const void *value, uint32_t value_len, TableMutatorAsync *value_index_mutator, TableMutatorAsync *qualifier_index_mutator)
std::map< String, TablePtr > TableMap
A class managing one or more serializable ByteStrings.
Provides the ability to mutate a table in the form of adding and deleting rows and cells...
TableMutatorAsync * m_qualifier_index_mutator
Mutator for qualifier index table.
static TablePtr load_table(const String &table_name)
virtual void update_error(TableMutatorAsync *mutator, int error, FailedMutations &failedMutations)
Callback method for update errors.
std::shared_ptr< ScanCells > ScanCellsPtr
Smart pointer to ScanCells.
static Hyperspace::SessionPtr hyperspace
static std::string toplevel_dir
TableMutatorAsync * m_index_mutator
Mutator for value index table.
static NameIdMapperPtr ms_namemap
virtual void scan_error(TableScannerAsync *scanner, int error, const String &error_msg, bool eos)
Callback method for scan errors.
Compatibility Macros for C/C++.
std::shared_ptr< ApplicationQueueInterface > ApplicationQueueInterfacePtr
Smart pointer to ApplicationQueueInterface.
Declarations for IndexUpdater.
static Hypertable::RangeLocatorPtr range_locator
static String basename(String name, char separator= '/')
A posix-compliant basename() which strips directory names from a filename.
const uint8_t * ptr
The pointer to the serialized data.
static TableMap ms_index_cache
bool m_qualifier_index_map[256]
Provides access to internal components of opaque key.
This is a generic exception class for Hypertable.
static String dirname(String name, char separator= '/')
A posix-compliant dirname() which strips the last component from a file name.
std::shared_ptr< Schema > SchemaPtr
Smart pointer to Schema.
uint8_t column_family_code
static IndexUpdaterPtr create(const String &table_id, SchemaPtr &schema, bool has_index, bool has_qualifier_index)
Factory function.
ResultCallback * m_cb
Async mutator callback object.
static Hypertable::ApplicationQueuePtr app_queue
Represents an open table.
std::shared_ptr< NameIdMapper > NameIdMapperPtr
Smart pointer to NameIdMapper.
static const uint32_t FLAG_DELETE_CELL_VERSION
uint32_t decode_vi32(const uint8_t **bufp, size_t *remainp)
Decode a variable length encoded integer up to 32-bit.
void add(const Key &key, const ByteString &value)
Adds a key to index tables.
std::shared_ptr< Table > TablePtr
std::vector< FailedMutation > FailedMutations