0.9.8.10
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Member Functions | Private Types | Private Attributes | List of all members
Hypertable::TableMutatorShared Class Reference

A TableMutator that can be shared from multiple threads and incidentally has an option to do periodic flushes. More...

#include <TableMutatorShared.h>

Inheritance diagram for Hypertable::TableMutatorShared:
Inheritance graph
[legend]
Collaboration diagram for Hypertable::TableMutatorShared:
Collaboration graph
[legend]

Public Member Functions

 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 ~TableMutatorShared ()
 
virtual void set (const KeySpec &key, const void *value, uint32_t value_len)
 
virtual void set_delete (const KeySpec &key)
 
virtual void set_cells (const Cells &cells)
 
virtual void flush ()
 
virtual bool retry (uint32_t timeout_ms=0)
 
virtual uint64_t memory_used ()
 
virtual uint64_t get_resend_count ()
 
virtual void get_failed (FailedMutations &failed_mutations)
 
virtual bool need_retry ()
 
uint32_t flush_interval ()
 
void interval_flush ()
 Flush if necessary considering the flush interval. More...
 
- Public Member Functions inherited from Hypertable::TableMutator
 TableMutator (PropertiesPtr &props, Comm *comm, Table *table, RangeLocatorPtr &range_locator, uint32_t timeout_ms, uint32_t flags=0)
 Constructs the TableMutator object. More...
 
virtual ~TableMutator ()
 Destructor for TableMutator object Make sure buffers are flushed and unsynced rangeservers get synced. More...
 
void set (const KeySpec &key, const char *value)
 Convenient helper for null-terminated values. More...
 
void set (const KeySpec &key, const std::string &value)
 Convenient helper for std::string values. More...
 
uint64_t get_resend_count ()
 There are certain circumstances when mutations get flushed to the wrong range server due to stale range location information. More...
 
std::ostream & show_failed (const Exception &, std::ostream &=std::cout)
 Show failed mutations. More...
 
void update_ok ()
 
void update_error (int error, FailedMutations &failures)
 
int32_t get_last_error ()
 
- Public Member Functions inherited from Hypertable::ClientObject
virtual ~ClientObject ()
 Destructor. More...
 

Private Types

typedef TableMutator Parent
 

Private Attributes

std::recursive_mutex m_mutex
 
uint32_t m_flush_interval
 
std::chrono::steady_clock::time_point m_last_flush_ts
 
std::shared_ptr
< TableMutatorIntervalHandler
m_tick_handler
 

Additional Inherited Members

- Public Types inherited from Hypertable::TableMutator
enum  { FLAG_NO_LOG_SYNC = Table::MUTATOR_FLAG_NO_LOG_SYNC, FLAG_NO_LOG = Table::MUTATOR_FLAG_NO_LOG }
 

Detailed Description

A TableMutator that can be shared from multiple threads and incidentally has an option to do periodic flushes.

For best throughput use the vanilla TableMutator

Definition at line 38 of file TableMutatorShared.h.

Member Typedef Documentation

Definition at line 39 of file TableMutatorShared.h.

Constructor & Destructor Documentation

TableMutatorShared::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 
)
Parameters
propssmart pointer to the Comm layer
commpointer to the Comm layer
tablepointer to the table object
range_locatorsmart pointer to the range locator
app_queuepointer to the application queue
timeout_msmaximum time in milliseconds to allow methods to execute before throwing an exception
flush_interval_msperiod in milliseconds to flush
flagsrangeserver client update command flags

Definition at line 28 of file TableMutatorShared.cc.

TableMutatorShared::~TableMutatorShared ( )
virtual

Definition at line 44 of file TableMutatorShared.cc.

Member Function Documentation

virtual void Hypertable::TableMutatorShared::flush ( )
inlinevirtual
See also
TableMutator::flush

Reimplemented from Hypertable::TableMutator.

Definition at line 86 of file TableMutatorShared.h.

uint32_t Hypertable::TableMutatorShared::flush_interval ( )
inline

Definition at line 132 of file TableMutatorShared.h.

virtual void Hypertable::TableMutatorShared::get_failed ( FailedMutations failed_mutations)
inlinevirtual
See also
TableMutator::get_failed

Reimplemented from Hypertable::TableMutator.

Definition at line 119 of file TableMutatorShared.h.

virtual uint64_t Hypertable::TableMutatorShared::get_resend_count ( )
inlinevirtual
See also
TableMutator::get_resend_count

Definition at line 111 of file TableMutatorShared.h.

void TableMutatorShared::interval_flush ( )

Flush if necessary considering the flush interval.

Definition at line 50 of file TableMutatorShared.cc.

virtual uint64_t Hypertable::TableMutatorShared::memory_used ( )
inlinevirtual
See also
TableMutator:memory_used

Reimplemented from Hypertable::TableMutator.

Definition at line 103 of file TableMutatorShared.h.

virtual bool Hypertable::TableMutatorShared::need_retry ( )
inlinevirtual
See also
TableMutator::need_retry

Reimplemented from Hypertable::TableMutator.

Definition at line 127 of file TableMutatorShared.h.

virtual bool Hypertable::TableMutatorShared::retry ( uint32_t  timeout_ms = 0)
inlinevirtual
See also
TableMutator::retry

Reimplemented from Hypertable::TableMutator.

Definition at line 95 of file TableMutatorShared.h.

virtual void Hypertable::TableMutatorShared::set ( const KeySpec key,
const void *  value,
uint32_t  value_len 
)
inlinevirtual
See also
TableMutator::set

Reimplemented from Hypertable::TableMutator.

Definition at line 62 of file TableMutatorShared.h.

virtual void Hypertable::TableMutatorShared::set_cells ( const Cells cells)
inlinevirtual
See also
TableMutator::set_cells

Reimplemented from Hypertable::TableMutator.

Definition at line 78 of file TableMutatorShared.h.

virtual void Hypertable::TableMutatorShared::set_delete ( const KeySpec key)
inlinevirtual
See also
TableMutator::set_delete

Reimplemented from Hypertable::TableMutator.

Definition at line 70 of file TableMutatorShared.h.

Member Data Documentation

uint32_t Hypertable::TableMutatorShared::m_flush_interval
private

Definition at line 141 of file TableMutatorShared.h.

std::chrono::steady_clock::time_point Hypertable::TableMutatorShared::m_last_flush_ts
private

Definition at line 142 of file TableMutatorShared.h.

std::recursive_mutex Hypertable::TableMutatorShared::m_mutex
private

Definition at line 140 of file TableMutatorShared.h.

std::shared_ptr<TableMutatorIntervalHandler> Hypertable::TableMutatorShared::m_tick_handler
private

Definition at line 143 of file TableMutatorShared.h.


The documentation for this class was generated from the following files: