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

Public Member Functions

 SessionState ()
 
void ToThrift (const TUniqueId &session_id, TSessionState *session_state)
 

Public Attributes

TSessionType::type session_type
 
TimestampValue start_time
 Time the session was created. More...
 
std::string connected_user
 Connected user for this session, i.e. the user which originated this session. More...
 
std::string do_as_user
 The user to delegate to. Empty for no delegation. More...
 
TNetworkAddress network_address
 Client network address. More...
 
boost::mutex lock
 
bool closed
 If true, the session has been closed. More...
 
bool expired
 
std::string database
 The default database (changed as a result of 'use' query execution) More...
 
TQueryOptions default_query_options
 The default query options of this session. More...
 
apache::hive::service::cli::thrift::TProtocolVersion::type hs2_version
 For HS2 only, the protocol version this session is expecting. More...
 
boost::unordered_set< TUniqueId > inflight_queries
 Inflight queries belonging to this session. More...
 
int64_t last_accessed_ms
 Time the session was last accessed. More...
 
uint32_t ref_count
 

Detailed Description

Per-session state. This object is reference counted using shared_ptrs. There is one ref count in the SessionStateMap for as long as the session is active. All queries running from this session also have a reference.

Definition at line 776 of file impala-server.h.

Constructor & Destructor Documentation

impala::ImpalaServer::SessionState::SessionState ( )
inline

The default hs2_version must be V1 so that child queries (which use HS2, but may run as children of Beeswax sessions) get results back in the expected format - child queries inherit the HS2 version from their parents, and a Beeswax session will never update the HS2 version from the default.

Definition at line 781 of file impala-server.h.

Member Function Documentation

void impala::ImpalaServer::SessionState::ToThrift ( const TUniqueId &  session_id,
TSessionState *  session_state 
)

Builds a Thrift representation of this SessionState for serialisation to the frontend.

Definition at line 1070 of file impala-server.cc.

References connected_user, database, do_as_user, lock, network_address, and session_type.

Member Data Documentation

bool impala::ImpalaServer::SessionState::closed

If true, the session has been closed.

Definition at line 804 of file impala-server.h.

std::string impala::ImpalaServer::SessionState::connected_user

Connected user for this session, i.e. the user which originated this session.

Definition at line 791 of file impala-server.h.

Referenced by ToThrift().

std::string impala::ImpalaServer::SessionState::database

The default database (changed as a result of 'use' query execution)

Definition at line 813 of file impala-server.h.

Referenced by ToThrift().

TQueryOptions impala::ImpalaServer::SessionState::default_query_options

The default query options of this session.

Definition at line 816 of file impala-server.h.

std::string impala::ImpalaServer::SessionState::do_as_user

The user to delegate to. Empty for no delegation.

Definition at line 794 of file impala-server.h.

Referenced by ToThrift().

bool impala::ImpalaServer::SessionState::expired

If true, the session was idle for too long and has been expired. Only set when ref_count == 0, after which point ref_count should never become non-zero (since clients will use ScopedSessionState to access the session, which will prevent use after expiration).

Definition at line 810 of file impala-server.h.

apache::hive::service::cli::thrift::TProtocolVersion::type impala::ImpalaServer::SessionState::hs2_version

For HS2 only, the protocol version this session is expecting.

Definition at line 819 of file impala-server.h.

boost::unordered_set<TUniqueId> impala::ImpalaServer::SessionState::inflight_queries

Inflight queries belonging to this session.

Definition at line 822 of file impala-server.h.

int64_t impala::ImpalaServer::SessionState::last_accessed_ms

Time the session was last accessed.

Definition at line 825 of file impala-server.h.

boost::mutex impala::ImpalaServer::SessionState::lock

Protects all fields below If this lock has to be taken with query_exec_state_map_lock, take this lock first.

Definition at line 801 of file impala-server.h.

Referenced by ToThrift().

TNetworkAddress impala::ImpalaServer::SessionState::network_address

Client network address.

Definition at line 797 of file impala-server.h.

Referenced by impala::ImpalaServer::LogAuditRecord(), and ToThrift().

uint32_t impala::ImpalaServer::SessionState::ref_count

Number of RPCs concurrently accessing this session state. Used to detect when a session may be correctly expired after a timeout (when ref_count == 0). Typically at most one RPC will be issued against a session at a time, but clients may do something unexpected and, for example, poll in one thread and fetch in another.

Definition at line 831 of file impala-server.h.

TSessionType::type impala::ImpalaServer::SessionState::session_type

Definition at line 785 of file impala-server.h.

Referenced by ToThrift().

TimestampValue impala::ImpalaServer::SessionState::start_time

Time the session was created.

Definition at line 788 of file impala-server.h.


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