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

Class used to hold pending request callback handlers. More...

#include <RequestCache.h>

Collaboration diagram for Hypertable::RequestCache:
Collaboration graph
[legend]

Classes

class  CacheNode
 Internal cache node structure. More...
 

Public Member Functions

 RequestCache ()
 Constructor. More...
 
void insert (uint32_t id, IOHandler *handler, DispatchHandler *dh, ClockT::time_point &expire)
 Inserts pending request callback handler into cache. More...
 
bool remove (uint32_t id, DispatchHandler *&handler)
 Removes a request from the cache. More...
 
bool get_next_timeout (ClockT::time_point &now, IOHandler *&handlerp, DispatchHandler *&dh, ClockT::time_point *next_timeout)
 Removes next request that has timed out. More...
 
void purge_requests (IOHandler *handler, int32_t error)
 Purges all requests assocated with handler. More...
 

Private Types

typedef std::unordered_map
< uint32_t, CacheNode * > 
IdHandlerMap
 RequestID-to-CacheNode map. More...
 

Private Attributes

IdHandlerMap m_id_map
 RequestID-to-CacheNode map. More...
 
CacheNodem_head
 Head of doubly-linked list. More...
 
CacheNodem_tail {}
 Tail of doubly-linked list. More...
 

Detailed Description

Class used to hold pending request callback handlers.

One RequestCache object is associated with each Reactor. When a request is sent (see Comm::send_request) an entry, which includes the response handler, is inserted into the RequestCache. When the corresponding response is receive, the response handler is obtained by looking up the corresponding request ID in this cache.

Definition at line 50 of file RequestCache.h.


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