Impala
Impalaistheopensource,nativeanalyticdatabaseforApacheHadoop.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
fragment-mgr.h
Go to the documentation of this file.
1 // Copyright 2014 Cloudera Inc.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #ifndef IMPALA_SERVICE_FRAGMENT_MGR_H
16 #define IMPALA_SERVICE_FRAGMENT_MGR_H
17 
18 #include <boost/shared_ptr.hpp>
19 #include <boost/thread/mutex.hpp>
20 #include <boost/unordered_map.hpp>
21 
22 #include "gen-cpp/ImpalaInternalService.h"
23 #include "common/status.h"
24 
25 namespace impala {
26 
29 //
34 //
38 class FragmentMgr {
39  public:
44  Status ExecPlanFragment(const TExecPlanFragmentParams& params);
45 
47  void CancelPlanFragment(TCancelPlanFragmentResult& return_val,
48  const TCancelPlanFragmentParams& params);
49 
50  class FragmentExecState;
51 
54  boost::shared_ptr<FragmentExecState> GetFragmentExecState(
55  const TUniqueId& fragment_instance_id);
56 
57  private:
60  void FragmentExecThread(FragmentExecState* exec_state);
61 
64 
67  typedef boost::unordered_map<TUniqueId, boost::shared_ptr<FragmentExecState> >
70 };
71 
72 }
73 
74 #endif
FragmentExecStateMap fragment_exec_state_map_
Definition: fragment-mgr.h:69
void FragmentExecThread(FragmentExecState *exec_state)
Definition: fragment-mgr.cc:68
boost::mutex fragment_exec_state_map_lock_
protects fragment_exec_state_map_
Definition: fragment-mgr.h:63
Status ExecPlanFragment(const TExecPlanFragmentParams &params)
Definition: fragment-mgr.cc:35
boost::shared_ptr< FragmentExecState > GetFragmentExecState(const TUniqueId &fragment_instance_id)
boost::unordered_map< TUniqueId, boost::shared_ptr< FragmentExecState > > FragmentExecStateMap
Definition: fragment-mgr.h:68
void CancelPlanFragment(TCancelPlanFragmentResult &return_val, const TCancelPlanFragmentParams &params)
Cancels a plan fragment that is running asynchronously.
Execution state of a single plan fragment.