22 #ifndef Hypertable_Lib_TableMutatorAsync_h
23 #define Hypertable_Lib_TableMutatorAsync_h
40 #include <condition_variable>
83 uint32_t flags = 0,
bool explicit_block_only =
false);
88 uint32_t flags = 0,
bool explicit_block_only =
false,
122 void set(
const KeySpec &key,
const void *value, uint32_t value_len);
129 set(key, value, strlen(value));
138 set(key, value.data(), value.length());
166 void set_cells(Cells::const_iterator start, Cells::const_iterator end);
172 void flush(
bool sync=
true);
185 bool retry(uint32_t timeout_ms);
192 std::lock_guard<std::mutex> lock(
m_mutex);
234 void to_full_key(
const void *row,
const char *cf,
const void *cq,
235 int64_t ts, int64_t rev, uint8_t flag,
Key &full_key,
304 #endif // Hypertable_Lib_TableMutatorAsync_h
std::vector< Cell, CellAlloc > Cells
void initialize(PropertiesPtr &props)
void initialize_indices(PropertiesPtr &props)
std::string String
A String is simply a typedef to std::string.
std::shared_ptr< RangeLocator > RangeLocatorPtr
Smart pointer to RangeLocator.
ScatterBufferAsyncMap m_outstanding_buffers
Declarations for TableIdentifier and TableIdentifierManaged.
std::mutex m_member_mutex
TableIdentifierManaged m_table_identifier
const char * column_qualifier
void set(const KeySpec &key, const void *value, uint32_t value_len)
Inserts a cell into the table.
Program options handling.
std::shared_ptr< TableMutatorAsyncScatterBuffer > TableMutatorAsyncScatterBufferPtr
Smart pointer to TableMutatorAsyncScatterBuffer.
std::mutex m_buffer_mutex
Column family specification.
TableMutatorAsyncPtr m_qualifier_index_mutator
const char * column_qualifier
void set(const KeySpec &key, const std::string &value)
Convenient helper for std::string values.
void to_full_key(const void *row, const char *cf, const void *cq, int64_t ts, int64_t rev, uint8_t flag, Key &full_key, ColumnFamilySpec **pcf=0)
void set_delete(const KeySpec &key)
Deletes an entire row, a column family in a particular row, or a specific cell within a row...
void flush_with_tablequeue(TableMutator *mutator, bool sync=true)
FailedMutations m_failed_mutations
void to_full_key(const KeySpec &key, Key &full_key, ColumnFamilySpec **cf=0)
void flush(bool sync=true)
Flushes the current buffer accumulated mutations to their respective range servers.
std::shared_ptr< IndexMutatorCallback > IndexMutatorCallbackPtr
void handle_send_exceptions(const String &info)
void update_with_index(Key &key, const ColumnFamilySpec *cf, const void *value, uint32_t value_len)
Provides the ability to mutate a table in the form of adding and deleting rows and cells...
Wrapper for TableIdentifier providing member storage.
std::shared_ptr< TableMutatorAsync > TableMutatorAsyncPtr
Represents an open table.
Provides the ability to mutate a table in the form of adding and deleting rows and cells...
IndexMutatorCallbackPtr m_imc
void set(const KeySpec &key, const char *value)
Convenient helper for null-terminated values.
void set_cells(const Cells &cells)
Insert a bunch of cells into the table (atomically if cells are in the same range/row) ...
bool retry(uint32_t timeout_ms)
virtual ~TableMutatorAsync()
Destructor for TableMutatorAsync object Make sure buffers are flushed and unsynced rangeservers get s...
void buffer_finish(uint32_t id, int error, bool retry)
This is where buffers call back into when their outstanding operations are complete.
std::shared_ptr< Properties > PropertiesPtr
void update_unsynced_rangeservers(const CommAddressSet &unsynced)
A timer class to keep timeout states across AsyncComm related calls.
TableMutatorAsyncPtr m_index_mutator
bool key_uses_index(Key &key)
void update_without_index(const Cell &cell)
CommAddressSet m_unsynced_rangeservers
Declarations for ClientObject.
static const uint32_t ms_max_sync_retries
std::shared_ptr< ApplicationQueueInterface > ApplicationQueueInterfacePtr
Smart pointer to ApplicationQueueInterface.
TableMutatorAsyncScatterBufferPtr m_current_buffer
TableMutatorAsync(PropertiesPtr &props, Comm *comm, ApplicationQueueInterfacePtr &app_queue, Table *table, RangeLocatorPtr &range_locator, uint32_t timeout_ms, ResultCallback *cb, uint32_t flags=0, bool explicit_block_only=false)
Constructs the TableMutatorAsync object.
virtual uint64_t memory_used()
Returns the amount of memory used by the collected mutations in the current buffer.
void do_sync()
Calls sync on any unsynced rangeservers and waits for completion.
Base class for Hypertable client objects.
bool m_explicit_block_only
std::set< CommAddress > CommAddressSet
Set of CommAddress objects.
void get_failed_mutations(FailedMutations &failed_mutations)
RangeLocatorPtr m_range_locator
Entry point to AsyncComm service.
TableMutatorAsyncScatterBufferPtr get_outstanding_buffer(size_t id)
Declarations for ConnectionManager.
bool has_outstanding_unlocked()
void get_unsynced_rangeservers(std::vector< CommAddress > &unsynced)
uint32_t m_next_buffer_id
void update_outstanding(TableMutatorAsyncScatterBufferPtr &buffer)
const char * column_family
std::condition_variable & m_cond
ResultCallback for secondary indices; used by TableMutatorAsync.
Provides access to internal components of opaque key.
void wait_for_completion()
Declarations for TableMutatorAsyncScatterBuffer.
std::shared_ptr< Schema > SchemaPtr
Smart pointer to Schema.
void to_full_key(const Cell &cell, Key &full_key, ColumnFamilySpec **cf=0)
ApplicationQueueInterfacePtr m_app_queue
std::map< uint32_t, TableMutatorAsyncScatterBufferPtr > ScatterBufferAsyncMap
Encapsulates decomposed key and value.
Represents an open table.
String extensions and helpers: sets, maps, append operators etc.
const char * column_family
std::condition_variable m_buffer_cond
uint64_t get_resend_count()
There are certain circumstances when mutations get flushed to the wrong range server due to stale ran...
std::vector< FailedMutation > FailedMutations