28 #ifndef Hypertable_Master_ResponseManager_h
29 #define Hypertable_Master_ResponseManager_h
41 #include <boost/graph/adjacency_list.hpp>
42 #include <boost/graph/properties.hpp>
43 #include <boost/multi_index/hashed_index.hpp>
44 #include <boost/multi_index/member.hpp>
45 #include <boost/multi_index/ordered_index.hpp>
46 #include <boost/multi_index_container.hpp>
47 #include <boost/thread/condition.hpp>
50 #include <condition_variable>
101 int64_t
id()
const {
return op->id(); }
111 typedef boost::multi_index_container<
116 &OperationRec::expiration_time> >,
117 hashed_unique<const_mem_fun<OperationRec, int64_t,
142 typedef boost::multi_index_container<
147 &DeliveryRec::expiration_time> >,
148 hashed_unique<member<DeliveryRec, int64_t,
275 void add_delivery_info(int64_t operation_id,
EventPtr &event);
280 std::lock_guard<std::mutex> lock(m_context->mutex);
281 m_context->mml_writer = mml_writer;
300 #endif // Hypertable_Master_ResponseManager_h
static Comm * instance()
Creates/returns singleton instance of the Comm class.
int64_t id() const
Returns unique ID for completed operation.
OperationList expirable_ops
List of completed operations.
ClockT::time_point expiration_time() const
Returns expiration time of completed operation.
int64_t id
Corresponding operation identifier.
boost::multi_index_container< DeliveryRec, indexed_by< sequenced<>, ordered_non_unique< member< DeliveryRec, ClockT::time_point,&DeliveryRec::expiration_time > >, hashed_unique< member< DeliveryRec, int64_t,&DeliveryRec::id > > > > DeliveryList
Multi-index container holding response delivery information for operations.
chrono::time_point< fast_clock > time_point
Declarations for Operation.
DeliveryList delivery_list
List of delivery information records.
DeliveryList::nth_index< 1 >::type DeliveryExpirationTimeIndex
std::shared_ptr< Event > EventPtr
Smart pointer to Event.
DeliveryList::nth_index< 0 >::type DeliverySequence
ClockT::time_point expiration_time
Delivery expiration time specified by client.
Record holding completed operation information.
std::shared_ptr< ResponseManagerContext > m_context
Pointer to shared context object.
ResponseManager()
Constructor.
std::mutex mutex
Mutex for serializing concurrent access
OperationList::nth_index< 2 >::type OperationIdentifierIndex
std::list< OperationPtr > removal_queue
Queue of completed operations to be removed from MML.
std::condition_variable cond
Condition variable used to wait for operations to expire.
Importing boost::thread and boost::thread_group into the Hypertable namespace.
Manages the sending of operation results back to clients.
Entry point to AsyncComm service.
OperationPtr op
Smart pointer to completed operation.
MetaLog::WriterPtr mml_writer
MML writer.
DeliveryList::nth_index< 2 >::type DeliveryIdentifierIndex
std::shared_ptr< Writer > WriterPtr
Smart pointer to Writer.
OperationRec(OperationPtr &_op)
Constructor.
Implementation shared by ResponseManager objects.
Record holding response delivery information for an operation.
boost::multi_index_container< OperationRec, indexed_by< sequenced<>, ordered_non_unique< const_mem_fun< OperationRec, ClockT::time_point,&OperationRec::expiration_time > >, hashed_unique< const_mem_fun< OperationRec, int64_t,&OperationRec::id > > > > OperationList
Multi-index container for completed operations.
EventPtr event
Event object containing return address for operation result.
std::shared_ptr< Operation > OperationPtr
Smart pointer to Operation.
Declarations for Context.
OperationList::nth_index< 1 >::type OperationExpirationTimeIndex
void set_mml_writer(MetaLog::WriterPtr &mml_writer)
Sets MML writer.
OperationList::nth_index< 0 >::type OperationSequence
ResponseManagerContext()
Constructor.