Impala
Impalaistheopensource,nativeanalyticdatabaseforApacheHadoop.
|
Classes | |
struct | TopicState |
Public Types | |
typedef boost::unordered_map < TopicId, TopicState > | Topics |
typedef boost::unordered_map < std::pair< TopicId, TopicEntryKey > , TopicEntry::Version > | TransientEntryMap |
Public Member Functions | |
Subscriber (const SubscriberId &subscriber_id, const TUniqueId ®istration_id, const TNetworkAddress &network_address, const std::vector< TTopicRegistration > &subscribed_topics) | |
const Topics & | subscribed_topics () const |
const TNetworkAddress & | network_address () const |
const SubscriberId & | id () const |
const TUniqueId & | registration_id () const |
void | AddTransientUpdate (const TopicId &topic_id, const TopicEntryKey &topic_key, TopicEntry::Version version) |
const TransientEntryMap & | transient_entries () const |
const TopicEntry::Version | LastTopicVersionProcessed (const TopicId &topic_id) const |
void | SetLastTopicVersionProcessed (const TopicId &topic_id, TopicEntry::Version version) |
Static Public Attributes | |
static const TopicEntry::Version | TOPIC_INITIAL_VERSION = 0L |
The Version value used to initialize new Topic subscriptions for this Subscriber. More... | |
Private Attributes | |
const SubscriberId | subscriber_id_ |
const TUniqueId | registration_id_ |
const TNetworkAddress | network_address_ |
The location of the subscriber service that this subscriber runs. More... | |
Topics | subscribed_topics_ |
TransientEntryMap | transient_entries_ |
The statestore-side representation of an individual subscriber client, which tracks a variety of bookkeeping information. This includes the list of subscribed topics (and whether updates to them should be deleted on failure), the list of updates made by this subscriber (in order to be able to efficiently delete them on failure), and the subscriber's ID and network location.
Definition at line 265 of file statestore.h.
typedef boost::unordered_map<TopicId, TopicState> impala::Statestore::Subscriber::Topics |
The set of topics subscribed to, and current state (as seen by this subscriber) of the topic.
Definition at line 281 of file statestore.h.
typedef boost::unordered_map<std::pair<TopicId, TopicEntryKey>, TopicEntry::Version> impala::Statestore::Subscriber::TransientEntryMap |
Map from the topic / key pair to the version of a transient update made by this subscriber.
Definition at line 302 of file statestore.h.
Statestore::Subscriber::Subscriber | ( | const SubscriberId & | subscriber_id, |
const TUniqueId & | registration_id, | ||
const TNetworkAddress & | network_address, | ||
const std::vector< TTopicRegistration > & | subscribed_topics | ||
) |
Definition at line 175 of file statestore.cc.
References impala::Statestore::Subscriber::TopicState::is_transient, impala::Statestore::Subscriber::TopicState::last_version, subscribed_topics_, and TOPIC_INITIAL_VERSION.
void Statestore::Subscriber::AddTransientUpdate | ( | const TopicId & | topic_id, |
const TopicEntryKey & | topic_key, | ||
TopicEntry::Version | version | ||
) |
Records the fact that an update to this topic is owned by this subscriber. The version number of the update is saved so that only those updates which are made most recently by this subscriber - and not overwritten by another subscriber - are deleted on failure. If the topic the entry belongs to is not marked as transient, no update will be recorded.
Definition at line 189 of file statestore.cc.
Referenced by impala::Statestore::SendTopicUpdate().
|
inline |
Definition at line 288 of file statestore.h.
References subscriber_id_.
Referenced by impala::Statestore::GatherTopicUpdates(), impala::Statestore::SendTopicUpdate(), and impala::Statestore::UnregisterSubscriber().
const Statestore::TopicEntry::Version Statestore::Subscriber::LastTopicVersionProcessed | ( | const TopicId & | topic_id | ) | const |
Returns the last version of the topic which this subscriber has successfully processed. Will never decrease.
Definition at line 199 of file statestore.cc.
Referenced by impala::Statestore::GatherTopicUpdates().
|
inline |
Definition at line 287 of file statestore.h.
References network_address_.
Referenced by impala::Statestore::SendHeartbeat(), impala::Statestore::SendTopicUpdate(), and impala::Statestore::UnregisterSubscriber().
|
inline |
Definition at line 289 of file statestore.h.
References registration_id_.
Referenced by impala::Statestore::SendHeartbeat(), impala::Statestore::SendTopicUpdate(), and impala::Statestore::UnregisterSubscriber().
void Statestore::Subscriber::SetLastTopicVersionProcessed | ( | const TopicId & | topic_id, |
TopicEntry::Version | version | ||
) |
Sets the subscriber's last processed version of the topic to the given value. This should only be set when once a subscriber has succesfully processed the given update corresponding to this version.
Definition at line 206 of file statestore.cc.
Referenced by impala::Statestore::SendTopicUpdate().
|
inline |
Definition at line 286 of file statestore.h.
References subscribed_topics_.
Referenced by impala::Statestore::GatherTopicUpdates().
|
inline |
Definition at line 304 of file statestore.h.
References transient_entries_.
Referenced by impala::Statestore::UnregisterSubscriber().
|
private |
The location of the subscriber service that this subscriber runs.
Definition at line 328 of file statestore.h.
Referenced by network_address().
|
private |
Unique identifier for the current registration of this subscriber. A new registration ID is handed out every time a subscriber successfully calls RegisterSubscriber() to distinguish between distinct connections from subscribers with the same subscriber_id_.
Definition at line 325 of file statestore.h.
Referenced by registration_id().
|
private |
Map of topic subscriptions to current TopicState. The the state describes whether updates on the topic are 'transient' (i.e., to be deleted upon subscriber failure) or not and contains the version number of the last update processed by this Subscriber on the topic.
Definition at line 334 of file statestore.h.
Referenced by subscribed_topics(), and Subscriber().
|
private |
Unique human-readable identifier for this subscriber, set by the subscriber itself on a Register call.
Definition at line 319 of file statestore.h.
Referenced by id().
|
static |
The Version value used to initialize new Topic subscriptions for this Subscriber.
Definition at line 284 of file statestore.h.
Referenced by impala::Statestore::GatherTopicUpdates(), impala::Statestore::GetMinSubscriberTopicVersion(), and Subscriber().
|
private |
List of updates made by this subscriber so that transient entries may be deleted on failure.
Definition at line 338 of file statestore.h.
Referenced by transient_entries().