Impala
Impalaistheopensource,nativeanalyticdatabaseforApacheHadoop.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
impala::ClientCacheHelper::PerHostCache Struct Reference
Collaboration diagram for impala::ClientCacheHelper::PerHostCache:

Public Attributes

boost::mutex lock
 Protects clients. More...
 
std::list< ClientKeyclients
 List of client keys for this entry's host. More...
 

Detailed Description

There are three lock categories - the cache-wide lock (cache_lock_), the locks for a specific cache (PerHostCache::lock) and the lock for the set of all clients (client_map_lock_). They do not have to be taken concurrently (and should not be, in general), but if they are they must be taken in this order: cache_lock_->PerHostCache::lock->client_map_lock_. A PerHostCache is a list of available client keys for a single host, plus a lock that protects that list. Only one PerHostCache will ever be created for a given host, so when a PerHostCache is retrieved from the PerHostCacheMap containing it there is no need to hold on to the container's lock. Only clients that are not currently in use are tracked in their host's PerHostCache. When a client is returned to the cache via ReleaseClient(), it is reinserted into its corresponding PerHostCache list. Clients returned by GetClient() are considered to be immediately in use, and so don't exist in their PerHostCache until they are released for the first time.

Definition at line 131 of file client-cache.h.

Member Data Documentation

std::list<ClientKey> impala::ClientCacheHelper::PerHostCache::clients

List of client keys for this entry's host.

Definition at line 136 of file client-cache.h.

Referenced by impala::ClientCacheHelper::CloseConnections().

boost::mutex impala::ClientCacheHelper::PerHostCache::lock

Protects clients.

Definition at line 133 of file client-cache.h.

Referenced by impala::ClientCacheHelper::CloseConnections().


The documentation for this struct was generated from the following file: