Impala
Impalaistheopensource,nativeanalyticdatabaseforApacheHadoop.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
process-state-info.h
Go to the documentation of this file.
1 // Copyright 2015 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_UTIL_PROCESS_STATE_INFO_H
16 #define IMPALA_UTIL_PROCESS_STATE_INFO_H
17 
18 #include <map>
19 #include <string>
20 
21 #include <boost/cstdint.hpp>
22 #include "common/logging.h"
23 #include "common/names.h"
24 
25 
26 namespace impala {
27 
40 
46 
59 
75 
79 
81  public:
85 
86  string DebugString() const;
87 
88  int GetInt(const string& state_key) const;
89  int64_t GetInt64(const string& state_key) const;
90  string GetString(const string& state_key) const;
91 
93  int64_t GetBytes(const string& state_key) const;
94  private:
95  typedef map<string, string> ProcessStateMap;
97 
99  typedef map<int, string> FileDescriptorMap;
101 
103  void ReadProcIO();
104 
106  void ReadProcCgroup();
107 
109  void ReadProcSched();
110 
112  void ReadProcStatus();
113 
116 };
117 
118 }
119 
120 #endif
void ReadProcFileDescriptorInfo()
Read file descriptors belong the process from /proc/<pid>/fd.
map< string, string > ProcessStateMap
int64_t GetBytes(const string &state_key) const
Original data's unit is B or KB.
void ReadProcIO()
Read I/O info from /proc/<pid>/io.
void ReadProcCgroup()
Read cgroup info from /proc/<pid>/cgroup.
int GetInt(const string &state_key) const
string GetString(const string &state_key) const
int64_t GetInt64(const string &state_key) const
ProcessStateMap process_state_map_
void ReadProcSched()
Read schedule info from /proc/<pid>/sched.
void ReadProcStatus()
Read status from /proc/<pid>/status.
map< int, string > FileDescriptorMap
The description info for each file.