22 #ifndef Hypertable_Lib_TableMutator_h
23 #define Hypertable_Lib_TableMutator_h
42 #include <condition_variable>
91 virtual void set(
const KeySpec &key,
const void *value, uint32_t value_len);
98 set(key, value, strlen(value));
107 set(key, value.data(), value.length());
131 virtual void flush();
139 virtual bool retry(uint32_t timeout_ms=0);
146 std::lock_guard<std::mutex> lock(
m_mutex);
174 std::lock_guard<std::mutex> lock(
m_mutex);
185 std::lock_guard<std::mutex> lock(
m_mutex);
197 std::lock_guard<std::mutex> lock(
m_mutex);
214 void save_last(Cells::const_iterator it, Cells::const_iterator end) {
219 void set_cells(Cells::const_iterator start, Cells::const_iterator end);
261 #endif // Hypertable_Lib_TableMutator_h
virtual uint64_t memory_used()
Returns the amount of memory used by the collected mutations.
void wait_for_flush_completion(TableMutatorAsync *mutator)
FailedMutations m_failed_mutations
void set_last_error(int32_t error)
std::vector< Cell, CellAlloc > Cells
CellsBuilderPtr m_failed_cells
std::shared_ptr< TableMutatorQueue > TableMutatorQueuePtr
Shared smart pointer to TableMutatorQueue.
std::ostream & show_failed(const Exception &, std::ostream &=std::cout)
Show failed mutations.
std::shared_ptr< RangeLocator > RangeLocatorPtr
Smart pointer to RangeLocator.
void save_last(const KeySpec &key, const void *value, size_t value_len)
virtual void set_delete(const KeySpec &key)
Deletes an entire row, a column family in a particular row, or a specific cell within a row...
Declarations for TableIdentifier and TableIdentifierManaged.
Program options handling.
const void * m_last_value
TableIdentifierManaged m_table_identifier
static const uint32_t ms_max_sync_retries
virtual void set(const KeySpec &key, const void *value, uint32_t value_len)
Inserts a cell into the table.
void set(const KeySpec &key, const char *value)
Convenient helper for null-terminated values.
Provides the ability to mutate a table in the form of adding and deleting rows and cells...
std::shared_ptr< TableMutatorAsync > TableMutatorAsyncPtr
Wrapper for TableIdentifier providing member storage.
Cells::const_iterator m_last_cells_it
Represents an open table.
virtual void set_cells(const Cells &cells)
Insert a bunch of cells into the table (atomically if cells are in the same range/row) ...
Represents an open table.
std::shared_ptr< TableMutator > TableMutatorPtr
Smart pointer to TableMutator.
Provides the ability to mutate a table in the form of adding and deleting rows and cells...
virtual ~TableMutator()
Destructor for TableMutator object Make sure buffers are flushed and unsynced rangeservers get synced...
RangeLocatorPtr m_range_locator
void set(const KeySpec &key, const std::string &value)
Convenient helper for std::string values.
std::shared_ptr< Properties > PropertiesPtr
A timer class to keep timeout states across AsyncComm related calls.
Declarations for ClientObject.
virtual void get_failed(FailedMutations &failed_mutations)
Returns the failed mutations.
virtual bool retry(uint32_t timeout_ms=0)
Retries the last operation.
Base class for Hypertable client objects.
std::shared_ptr< CellsBuilder > CellsBuilderPtr
Smart pointer to CellsBuilder.
void save_last(Cells::const_iterator it, Cells::const_iterator end)
Entry point to AsyncComm service.
Declarations for ConnectionManager.
uint64_t get_resend_count()
There are certain circumstances when mutations get flushed to the wrong range server due to stale ran...
TableMutatorAsyncPtr m_mutator
This is a generic exception class for Hypertable.
std::condition_variable m_cond
TableMutator(PropertiesPtr &props, Comm *comm, Table *table, RangeLocatorPtr &range_locator, uint32_t timeout_ms, uint32_t flags=0)
Constructs the TableMutator object.
std::shared_ptr< Schema > SchemaPtr
Smart pointer to Schema.
virtual void flush()
Flushes the accumulated mutations to their respective range servers.
void update_error(int error, FailedMutations &failures)
TableMutatorQueuePtr m_queue
String extensions and helpers: sets, maps, append operators etc.
uint32_t m_last_value_len
virtual bool need_retry()
Checks for failed mutations.
std::shared_ptr< Table > TablePtr
std::vector< FailedMutation > FailedMutations
Cells::const_iterator m_last_cells_end