15 #ifndef STATESTORE_QUERY_SCHEDULE_H
16 #define STATESTORE_QUERY_SCHEDULE_H
20 #include <boost/unordered_set.hpp>
21 #include <boost/unordered_map.hpp>
22 #include <boost/scoped_ptr.hpp>
29 #include "gen-cpp/Types_types.h"
30 #include "gen-cpp/Frontend_types.h"
31 #include "gen-cpp/ResourceBrokerService_types.h"
41 typedef boost::unordered_map<TNetworkAddress, PerNodeScanRanges>
48 std::vector<TNetworkAddress>
hosts;
103 DCHECK_GT(num_hosts, 0);
RuntimeProfile * summary_profile_
bool is_admitted_
Indicates if the query has been admitted for execution.
RuntimeProfile::EventSequence * query_events()
int64_t num_hosts() const
const TQueryOptions & query_options_
void set_request_pool(const std::string &pool_name)
std::vector< TNetworkAddress > hosts
std::vector< int32_t > plan_node_to_fragment_idx_
Maps from plan node id to its fragment index. Filled in c'tor.
int32_t GetFragmentIdx(PlanNodeId id) const
boost::unordered_map< TNetworkAddress, PerNodeScanRanges > FragmentScanRangeAssignment
std::vector< TPlanFragmentDestination > destinations
Status ValidateReservation()
int64_t GetPerHostMemoryEstimate() const
int64_t num_backends() const
bool HasReservation() const
const TUniqueId & query_id_
void PrepareReservationRequest(const std::string &pool, const std::string &user)
void GetResourceHostport(const TNetworkAddress &src, TNetworkAddress *dst)
void set_num_backends(int64_t num_backends)
bool NeedsRelease() const
void AddScanRanges(int64_t delta)
Helper methods used by scheduler to populate this QuerySchedule.
QuerySchedule(const TUniqueId &query_id, const TQueryExecRequest &request, const TQueryOptions &query_options, const std::string &effective_user, RuntimeProfile *summary_profile, RuntimeProfile::EventSequence *query_events)
const TUniqueId & query_id() const
FragmentScanRangeAssignment scan_range_assignment
std::map< TPlanNodeId, std::vector< TScanRangeParams > > PerNodeScanRanges
map from scan node id to a list of scan ranges
std::string request_pool_
Request pool to which the request was submitted for admission.
void set_num_hosts(int64_t num_hosts)
std::vector< FragmentExecParams > fragment_exec_params_
int64_t num_backends_
Number of backends executing plan fragments on behalf of this query.
const TQueryExecRequest & request_
std::vector< FragmentExecParams > * exec_params()
RuntimeProfile * summary_profile()
void SetUniqueHosts(const boost::unordered_set< TNetworkAddress > &unique_hosts)
int64_t num_scan_ranges() const
void set_is_admitted(bool is_admitted)
const std::string effective_user_
int16_t GetPerHostVCores() const
std::map< PlanNodeId, int > per_exch_num_senders
int64_t GetClusterMemoryEstimate() const
Total estimated memory for all nodes. set_num_hosts() must be set before calling. ...
const TResourceBrokerReservationRequest & reservation_request() const
const std::string & effective_user() const
const boost::unordered_set< TNetworkAddress > & unique_hosts() const
const std::string & request_pool() const
TResourceBrokerReservationResponse reservation_
Fulfilled reservation request. Populated by scheduler.
RuntimeProfile::EventSequence * query_events_
TResourceBrokerReservationResponse * reservation()
TResourceBrokerReservationRequest reservation_request_
Reservation request to be submitted to Llama. Set in PrepareReservationRequest(). ...
const TQueryOptions & query_options() const
boost::unordered_set< TNetworkAddress > unique_hosts_
The set of hosts that the query will run on excluding the coordinator.
std::vector< TUniqueId > instance_ids
int64_t num_scan_ranges_
Total number of scan ranges of this query.
const TQueryExecRequest & request() const
boost::scoped_ptr< ResourceResolver > resource_resolver_