ExecStats.thrift 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. // Copyright 2012 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. namespace cpp impala
  15. namespace java com.cloudera.impala.thrift
  16. include "Status.thrift"
  17. include "Types.thrift"
  18. enum TExecState {
  19. REGISTERED = 0,
  20. PLANNING = 1,
  21. QUEUED = 2,
  22. RUNNING = 3,
  23. FINISHED = 4,
  24. CANCELLED = 5,
  25. FAILED = 6,
  26. }
  27. // Execution stats for a single plan node.
  28. struct TExecStats {
  29. // The wall clock time spent on the "main" thread. This is the user perceived
  30. // latency. This value indicates the current bottleneck.
  31. // Note: anywhere we have a queue between operators, this time can fluctuate
  32. // significantly without the overall query time changing much (i.e. the bottleneck
  33. // moved to another operator). This is unavoidable though.
  34. 1: optional i64 latency_ns
  35. // Total CPU time spent across all threads. For operators that have an async
  36. // component (e.g. multi-threaded) this will be >= latency_ns.
  37. 2: optional i64 cpu_time_ns
  38. // Number of rows returned.
  39. 3: optional i64 cardinality
  40. // Peak memory used (in bytes).
  41. 4: optional i64 memory_used
  42. }
  43. // Summary for a single plan node. This includes labels for how to display the
  44. // node as well as per instance stats.
  45. struct TPlanNodeExecSummary {
  46. 1: required Types.TPlanNodeId node_id
  47. 2: required i32 fragment_id
  48. 3: required string label
  49. 4: optional string label_detail
  50. 5: required i32 num_children
  51. // Estimated stats generated by the planner
  52. 6: optional TExecStats estimated_stats
  53. // One entry for each BE executing this plan node.
  54. 7: optional list<TExecStats> exec_stats
  55. // One entry for each BE executing this plan node. True if this plan node is still
  56. // running.
  57. 8: optional list<bool> is_active
  58. // If true, this plan node is an exchange node that is the receiver of a broadcast.
  59. 9: optional bool is_broadcast
  60. }
  61. // Progress counters for an in-flight query.
  62. struct TExecProgress {
  63. 1: optional i64 total_scan_ranges
  64. 2: optional i64 num_completed_scan_ranges
  65. }
  66. // Execution summary of an entire query.
  67. struct TExecSummary {
  68. // State of the query.
  69. 1: required TExecState state
  70. // Contains the error if state is FAILED.
  71. 2: optional Status.TStatus status
  72. // Flattened execution summary of the plan tree.
  73. 3: optional list<TPlanNodeExecSummary> nodes
  74. // For each exch node in 'nodes', contains the index to the root node of the sending
  75. // fragment for this exch. Both the key and value are indices into 'nodes'.
  76. 4: optional map<i32, i32> exch_to_sender_map
  77. // List of errors that were encountered during execution. This can be non-empty
  78. // even if status is okay, in which case it contains errors that impala skipped
  79. // over.
  80. 5: optional list<string> error_logs
  81. // Optional record indicating the query progress
  82. 6: optional TExecProgress progress
  83. }