Impala
Impalaistheopensource,nativeanalyticdatabaseforApacheHadoop.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
impala::ClientConnection< T > Class Template Reference

#include <client-cache.h>

Collaboration diagram for impala::ClientConnection< T >:

Public Member Functions

 ClientConnection (ClientCache< T > *client_cache, TNetworkAddress address, Status *status)
 
 ~ClientConnection ()
 
Status Reopen ()
 
T * operator-> () const
 
template<class F , class Request , class Response >
Status DoRpc (const F &f, const Request &request, Response *response)
 

Private Attributes

ClientCache< T > * client_cache_
 
T * client_
 

Detailed Description

template<class T>
class impala::ClientConnection< T >

A scoped client connection to help manage clients from a client cache. Clients of this class should use DoRpc() to actually make RPC calls.

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

Constructor & Destructor Documentation

template<class T>
impala::ClientConnection< T >::ClientConnection ( ClientCache< T > *  client_cache,
TNetworkAddress  address,
Status status 
)
inline

Member Function Documentation

template<class T>
template<class F , class Request , class Response >
Status impala::ClientConnection< T >::DoRpc ( const F &  f,
const Request &  request,
Response *  response 
)
inline

Perform an RPC call f(request, response), with some failure handling in case the TCP connection underpinning this client has been closed unexpectedly. Note that this can lead to f() being called twice, as this method may retry f() once, depending on the error received from the first attempt. TODO: Detect already-closed cnxns and only retry in that case. Returns RPC_TIMEOUT if a timeout occurred, and RPC_GENERAL_ERROR if the RPC could not be completed for any other reason (except for an unexpectedly closed cnxn, see TODO). Application-level failures should be signalled through the response type. TODO: Use TTransportException::TTransportExceptionType to distinguish between failure modes.

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

References impala::ClientConnection< T >::client_, impala::IsTimeoutTException(), impala::Status::OK, impala::ClientConnection< T >::Reopen(), and RETURN_IF_ERROR.

Referenced by impala::DataStreamSender::Channel::CloseInternal(), impala::FragmentMgr::FragmentExecState::ReportStatusCb(), and impala::DataStreamSender::Channel::TransmitDataHelper().

template<class T>
T* impala::ClientConnection< T >::operator-> ( ) const
inline

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

References impala::ClientConnection< T >::client_.

Member Data Documentation


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