20 #ifndef Hypertable_Lib_TableMutatorShared_h
21 #define Hypertable_Lib_TableMutatorShared_h
55 uint32_t timeout_ms, uint32_t flush_interval_ms, uint32_t flags = 0);
62 virtual void set(
const KeySpec &key,
const void *value, uint32_t value_len) {
63 std::lock_guard<std::recursive_mutex> lock(
m_mutex);
71 std::lock_guard<std::recursive_mutex> lock(
m_mutex);
79 std::lock_guard<std::recursive_mutex> lock(
m_mutex);
87 std::lock_guard<std::recursive_mutex> lock(
m_mutex);
95 virtual bool retry(uint32_t timeout_ms = 0) {
96 std::lock_guard<std::recursive_mutex> lock(
m_mutex);
104 std::lock_guard<std::recursive_mutex> lock(
m_mutex);
112 std::lock_guard<std::recursive_mutex> lock(
m_mutex);
120 std::lock_guard<std::recursive_mutex> lock(
m_mutex);
128 std::lock_guard<std::recursive_mutex> lock(
m_mutex);
virtual uint64_t memory_used()
Returns the amount of memory used by the collected mutations.
std::vector< Cell, CellAlloc > Cells
virtual bool need_retry()
Timer handler for periodically flushing a shared mutator.
std::shared_ptr< RangeLocator > RangeLocatorPtr
Smart pointer to RangeLocator.
std::shared_ptr< TableMutatorIntervalHandler > m_tick_handler
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...
std::recursive_mutex m_mutex
uint32_t m_flush_interval
virtual void set(const KeySpec &key, const void *value, uint32_t value_len)
Inserts a cell into the table.
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) ...
Provides the ability to mutate a table in the form of adding and deleting rows and cells...
virtual void set(const KeySpec &key, const void *value, uint32_t value_len)
virtual void set_delete(const KeySpec &key)
std::shared_ptr< Properties > PropertiesPtr
std::shared_ptr< ApplicationQueueInterface > ApplicationQueueInterfacePtr
Smart pointer to ApplicationQueueInterface.
virtual void get_failed(FailedMutations &failed_mutations)
Returns the failed mutations.
virtual uint64_t memory_used()
virtual ~TableMutatorShared()
std::chrono::steady_clock::time_point m_last_flush_ts
virtual bool retry(uint32_t timeout_ms=0)
Retries the last operation.
void interval_flush()
Flush if necessary considering the flush interval.
Entry point to AsyncComm service.
uint32_t flush_interval()
uint64_t get_resend_count()
There are certain circumstances when mutations get flushed to the wrong range server due to stale ran...
TableMutatorShared(PropertiesPtr &props, Comm *comm, Table *table, RangeLocatorPtr &range_locator, ApplicationQueueInterfacePtr &app_queue, uint32_t timeout_ms, uint32_t flush_interval_ms, uint32_t flags=0)
virtual uint64_t get_resend_count()
virtual void flush()
Flushes the accumulated mutations to their respective range servers.
virtual void get_failed(FailedMutations &failed_mutations)
virtual void set_cells(const Cells &cells)
A TableMutator that can be shared from multiple threads and incidentally has an option to do periodic...
virtual bool retry(uint32_t timeout_ms=0)
virtual bool need_retry()
Checks for failed mutations.
std::vector< FailedMutation > FailedMutations