You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by zs...@apache.org on 2009/08/19 23:03:05 UTC
svn commit: r805973 [3/19] - in /hadoop/hive/trunk: ./ data/files/
eclipse-templates/
metastore/src/gen-javabean/org/apache/hadoop/hive/metastore/api/
metastore/src/gen-py/hive_metastore/ ql/ ql/if/ ql/src/gen-javabean/
ql/src/gen-javabean/org/ ql/src/...
Added: hadoop/hive/trunk/ql/src/gen-php/queryplan_types.php
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/ql/src/gen-php/queryplan_types.php?rev=805973&view=auto
==============================================================================
--- hadoop/hive/trunk/ql/src/gen-php/queryplan_types.php (added)
+++ hadoop/hive/trunk/ql/src/gen-php/queryplan_types.php Wed Aug 19 21:02:57 2009
@@ -0,0 +1,1735 @@
+<?php
+/**
+ * Autogenerated by Thrift
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ */
+include_once $GLOBALS['THRIFT_ROOT'].'/Thrift.php';
+
+
+$GLOBALS['E_AdjacencyType'] = array(
+ 'CONJUNCTIVE' => 0,
+ 'DISJUNCTIVE' => 1,
+);
+
+final class AdjacencyType {
+ const CONJUNCTIVE = 0;
+ const DISJUNCTIVE = 1;
+ static public $__names = array(
+ 0 => 'CONJUNCTIVE',
+ 1 => 'DISJUNCTIVE',
+ );
+}
+
+$GLOBALS['E_NodeType'] = array(
+ 'OPERATOR' => 0,
+ 'STAGE' => 1,
+);
+
+final class NodeType {
+ const OPERATOR = 0;
+ const STAGE = 1;
+ static public $__names = array(
+ 0 => 'OPERATOR',
+ 1 => 'STAGE',
+ );
+}
+
+$GLOBALS['E_OperatorType'] = array(
+ 'JOIN' => 0,
+ 'MAPJOIN' => 1,
+ 'EXTRACT' => 2,
+ 'FILTER' => 3,
+ 'FORWARD' => 4,
+ 'GROUPBY' => 5,
+ 'LIMIT' => 6,
+ 'SCRIPT' => 7,
+ 'SELECT' => 8,
+ 'TABLESCAN' => 9,
+ 'FILESINK' => 10,
+ 'REDUCESINK' => 11,
+ 'UNION' => 12,
+);
+
+final class OperatorType {
+ const JOIN = 0;
+ const MAPJOIN = 1;
+ const EXTRACT = 2;
+ const FILTER = 3;
+ const FORWARD = 4;
+ const GROUPBY = 5;
+ const LIMIT = 6;
+ const SCRIPT = 7;
+ const SELECT = 8;
+ const TABLESCAN = 9;
+ const FILESINK = 10;
+ const REDUCESINK = 11;
+ const UNION = 12;
+ static public $__names = array(
+ 0 => 'JOIN',
+ 1 => 'MAPJOIN',
+ 2 => 'EXTRACT',
+ 3 => 'FILTER',
+ 4 => 'FORWARD',
+ 5 => 'GROUPBY',
+ 6 => 'LIMIT',
+ 7 => 'SCRIPT',
+ 8 => 'SELECT',
+ 9 => 'TABLESCAN',
+ 10 => 'FILESINK',
+ 11 => 'REDUCESINK',
+ 12 => 'UNION',
+ );
+}
+
+$GLOBALS['E_TaskType'] = array(
+ 'MAP' => 0,
+ 'REDUCE' => 1,
+ 'OTHER' => 2,
+);
+
+final class TaskType {
+ const MAP = 0;
+ const REDUCE = 1;
+ const OTHER = 2;
+ static public $__names = array(
+ 0 => 'MAP',
+ 1 => 'REDUCE',
+ 2 => 'OTHER',
+ );
+}
+
+$GLOBALS['E_StageType'] = array(
+ 'CONDITIONAL' => 0,
+ 'COPY' => 1,
+ 'DDL' => 2,
+ 'MAPRED' => 3,
+ 'EXPLAIN' => 4,
+ 'FETCH' => 5,
+ 'FUNC' => 6,
+ 'MAPREDLOCAL' => 7,
+ 'MOVE' => 8,
+);
+
+final class StageType {
+ const CONDITIONAL = 0;
+ const COPY = 1;
+ const DDL = 2;
+ const MAPRED = 3;
+ const EXPLAIN = 4;
+ const FETCH = 5;
+ const FUNC = 6;
+ const MAPREDLOCAL = 7;
+ const MOVE = 8;
+ static public $__names = array(
+ 0 => 'CONDITIONAL',
+ 1 => 'COPY',
+ 2 => 'DDL',
+ 3 => 'MAPRED',
+ 4 => 'EXPLAIN',
+ 5 => 'FETCH',
+ 6 => 'FUNC',
+ 7 => 'MAPREDLOCAL',
+ 8 => 'MOVE',
+ );
+}
+
+class Adjacency {
+ static $_TSPEC;
+
+ public $node = null;
+ public $children = null;
+ public $adjacencyType = null;
+
+ public function __construct($vals=null) {
+ if (!isset(self::$_TSPEC)) {
+ self::$_TSPEC = array(
+ 1 => array(
+ 'var' => 'node',
+ 'type' => TType::STRING,
+ ),
+ 2 => array(
+ 'var' => 'children',
+ 'type' => TType::LST,
+ 'etype' => TType::STRING,
+ 'elem' => array(
+ 'type' => TType::STRING,
+ ),
+ ),
+ 3 => array(
+ 'var' => 'adjacencyType',
+ 'type' => TType::I32,
+ ),
+ );
+ }
+ if (is_array($vals)) {
+ if (isset($vals['node'])) {
+ $this->node = $vals['node'];
+ }
+ if (isset($vals['children'])) {
+ $this->children = $vals['children'];
+ }
+ if (isset($vals['adjacencyType'])) {
+ $this->adjacencyType = $vals['adjacencyType'];
+ }
+ }
+ }
+
+ public function getName() {
+ return 'Adjacency';
+ }
+
+ public function read($input)
+ {
+ $xfer = 0;
+ $fname = null;
+ $ftype = 0;
+ $fid = 0;
+ $xfer += $input->readStructBegin($fname);
+ while (true)
+ {
+ $xfer += $input->readFieldBegin($fname, $ftype, $fid);
+ if ($ftype == TType::STOP) {
+ break;
+ }
+ switch ($fid)
+ {
+ case 1:
+ if ($ftype == TType::STRING) {
+ $xfer += $input->readString($this->node);
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
+ case 2:
+ if ($ftype == TType::LST) {
+ $this->children = array();
+ $_size0 = 0;
+ $_etype3 = 0;
+ $xfer += $input->readListBegin($_etype3, $_size0);
+ for ($_i4 = 0; $_i4 < $_size0; ++$_i4)
+ {
+ $elem5 = null;
+ $xfer += $input->readString($elem5);
+ $this->children []= $elem5;
+ }
+ $xfer += $input->readListEnd();
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
+ case 3:
+ if ($ftype == TType::I32) {
+ $xfer += $input->readI32($this->adjacencyType);
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
+ default:
+ $xfer += $input->skip($ftype);
+ break;
+ }
+ $xfer += $input->readFieldEnd();
+ }
+ $xfer += $input->readStructEnd();
+ return $xfer;
+ }
+
+ public function write($output) {
+ $xfer = 0;
+ $xfer += $output->writeStructBegin('Adjacency');
+ if ($this->node !== null) {
+ $xfer += $output->writeFieldBegin('node', TType::STRING, 1);
+ $xfer += $output->writeString($this->node);
+ $xfer += $output->writeFieldEnd();
+ }
+ if ($this->children !== null) {
+ if (!is_array($this->children)) {
+ throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
+ }
+ $xfer += $output->writeFieldBegin('children', TType::LST, 2);
+ {
+ $output->writeListBegin(TType::STRING, count($this->children));
+ {
+ foreach ($this->children as $iter6)
+ {
+ $xfer += $output->writeString($iter6);
+ }
+ }
+ $output->writeListEnd();
+ }
+ $xfer += $output->writeFieldEnd();
+ }
+ if ($this->adjacencyType !== null) {
+ $xfer += $output->writeFieldBegin('adjacencyType', TType::I32, 3);
+ $xfer += $output->writeI32($this->adjacencyType);
+ $xfer += $output->writeFieldEnd();
+ }
+ $xfer += $output->writeFieldStop();
+ $xfer += $output->writeStructEnd();
+ return $xfer;
+ }
+
+}
+
+class Graph {
+ static $_TSPEC;
+
+ public $nodeType = null;
+ public $roots = null;
+ public $adjacencyList = null;
+
+ public function __construct($vals=null) {
+ if (!isset(self::$_TSPEC)) {
+ self::$_TSPEC = array(
+ 1 => array(
+ 'var' => 'nodeType',
+ 'type' => TType::I32,
+ ),
+ 2 => array(
+ 'var' => 'roots',
+ 'type' => TType::LST,
+ 'etype' => TType::STRING,
+ 'elem' => array(
+ 'type' => TType::STRING,
+ ),
+ ),
+ 3 => array(
+ 'var' => 'adjacencyList',
+ 'type' => TType::LST,
+ 'etype' => TType::STRUCT,
+ 'elem' => array(
+ 'type' => TType::STRUCT,
+ 'class' => 'Adjacency',
+ ),
+ ),
+ );
+ }
+ if (is_array($vals)) {
+ if (isset($vals['nodeType'])) {
+ $this->nodeType = $vals['nodeType'];
+ }
+ if (isset($vals['roots'])) {
+ $this->roots = $vals['roots'];
+ }
+ if (isset($vals['adjacencyList'])) {
+ $this->adjacencyList = $vals['adjacencyList'];
+ }
+ }
+ }
+
+ public function getName() {
+ return 'Graph';
+ }
+
+ public function read($input)
+ {
+ $xfer = 0;
+ $fname = null;
+ $ftype = 0;
+ $fid = 0;
+ $xfer += $input->readStructBegin($fname);
+ while (true)
+ {
+ $xfer += $input->readFieldBegin($fname, $ftype, $fid);
+ if ($ftype == TType::STOP) {
+ break;
+ }
+ switch ($fid)
+ {
+ case 1:
+ if ($ftype == TType::I32) {
+ $xfer += $input->readI32($this->nodeType);
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
+ case 2:
+ if ($ftype == TType::LST) {
+ $this->roots = array();
+ $_size7 = 0;
+ $_etype10 = 0;
+ $xfer += $input->readListBegin($_etype10, $_size7);
+ for ($_i11 = 0; $_i11 < $_size7; ++$_i11)
+ {
+ $elem12 = null;
+ $xfer += $input->readString($elem12);
+ $this->roots []= $elem12;
+ }
+ $xfer += $input->readListEnd();
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
+ case 3:
+ if ($ftype == TType::LST) {
+ $this->adjacencyList = array();
+ $_size13 = 0;
+ $_etype16 = 0;
+ $xfer += $input->readListBegin($_etype16, $_size13);
+ for ($_i17 = 0; $_i17 < $_size13; ++$_i17)
+ {
+ $elem18 = null;
+ $elem18 = new Adjacency();
+ $xfer += $elem18->read($input);
+ $this->adjacencyList []= $elem18;
+ }
+ $xfer += $input->readListEnd();
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
+ default:
+ $xfer += $input->skip($ftype);
+ break;
+ }
+ $xfer += $input->readFieldEnd();
+ }
+ $xfer += $input->readStructEnd();
+ return $xfer;
+ }
+
+ public function write($output) {
+ $xfer = 0;
+ $xfer += $output->writeStructBegin('Graph');
+ if ($this->nodeType !== null) {
+ $xfer += $output->writeFieldBegin('nodeType', TType::I32, 1);
+ $xfer += $output->writeI32($this->nodeType);
+ $xfer += $output->writeFieldEnd();
+ }
+ if ($this->roots !== null) {
+ if (!is_array($this->roots)) {
+ throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
+ }
+ $xfer += $output->writeFieldBegin('roots', TType::LST, 2);
+ {
+ $output->writeListBegin(TType::STRING, count($this->roots));
+ {
+ foreach ($this->roots as $iter19)
+ {
+ $xfer += $output->writeString($iter19);
+ }
+ }
+ $output->writeListEnd();
+ }
+ $xfer += $output->writeFieldEnd();
+ }
+ if ($this->adjacencyList !== null) {
+ if (!is_array($this->adjacencyList)) {
+ throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
+ }
+ $xfer += $output->writeFieldBegin('adjacencyList', TType::LST, 3);
+ {
+ $output->writeListBegin(TType::STRUCT, count($this->adjacencyList));
+ {
+ foreach ($this->adjacencyList as $iter20)
+ {
+ $xfer += $iter20->write($output);
+ }
+ }
+ $output->writeListEnd();
+ }
+ $xfer += $output->writeFieldEnd();
+ }
+ $xfer += $output->writeFieldStop();
+ $xfer += $output->writeStructEnd();
+ return $xfer;
+ }
+
+}
+
+class Operator {
+ static $_TSPEC;
+
+ public $operatorId = null;
+ public $operatorType = null;
+ public $operatorAttributes = null;
+ public $operatorCounters = null;
+ public $done = null;
+ public $started = null;
+
+ public function __construct($vals=null) {
+ if (!isset(self::$_TSPEC)) {
+ self::$_TSPEC = array(
+ 1 => array(
+ 'var' => 'operatorId',
+ 'type' => TType::STRING,
+ ),
+ 2 => array(
+ 'var' => 'operatorType',
+ 'type' => TType::I32,
+ ),
+ 3 => array(
+ 'var' => 'operatorAttributes',
+ 'type' => TType::MAP,
+ 'ktype' => TType::STRING,
+ 'vtype' => TType::STRING,
+ 'key' => array(
+ 'type' => TType::STRING,
+ ),
+ 'val' => array(
+ 'type' => TType::STRING,
+ ),
+ ),
+ 4 => array(
+ 'var' => 'operatorCounters',
+ 'type' => TType::MAP,
+ 'ktype' => TType::STRING,
+ 'vtype' => TType::I64,
+ 'key' => array(
+ 'type' => TType::STRING,
+ ),
+ 'val' => array(
+ 'type' => TType::I64,
+ ),
+ ),
+ 5 => array(
+ 'var' => 'done',
+ 'type' => TType::BOOL,
+ ),
+ 6 => array(
+ 'var' => 'started',
+ 'type' => TType::BOOL,
+ ),
+ );
+ }
+ if (is_array($vals)) {
+ if (isset($vals['operatorId'])) {
+ $this->operatorId = $vals['operatorId'];
+ }
+ if (isset($vals['operatorType'])) {
+ $this->operatorType = $vals['operatorType'];
+ }
+ if (isset($vals['operatorAttributes'])) {
+ $this->operatorAttributes = $vals['operatorAttributes'];
+ }
+ if (isset($vals['operatorCounters'])) {
+ $this->operatorCounters = $vals['operatorCounters'];
+ }
+ if (isset($vals['done'])) {
+ $this->done = $vals['done'];
+ }
+ if (isset($vals['started'])) {
+ $this->started = $vals['started'];
+ }
+ }
+ }
+
+ public function getName() {
+ return 'Operator';
+ }
+
+ public function read($input)
+ {
+ $xfer = 0;
+ $fname = null;
+ $ftype = 0;
+ $fid = 0;
+ $xfer += $input->readStructBegin($fname);
+ while (true)
+ {
+ $xfer += $input->readFieldBegin($fname, $ftype, $fid);
+ if ($ftype == TType::STOP) {
+ break;
+ }
+ switch ($fid)
+ {
+ case 1:
+ if ($ftype == TType::STRING) {
+ $xfer += $input->readString($this->operatorId);
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
+ case 2:
+ if ($ftype == TType::I32) {
+ $xfer += $input->readI32($this->operatorType);
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
+ case 3:
+ if ($ftype == TType::MAP) {
+ $this->operatorAttributes = array();
+ $_size21 = 0;
+ $_ktype22 = 0;
+ $_vtype23 = 0;
+ $xfer += $input->readMapBegin($_ktype22, $_vtype23, $_size21);
+ for ($_i25 = 0; $_i25 < $_size21; ++$_i25)
+ {
+ $key26 = '';
+ $val27 = '';
+ $xfer += $input->readString($key26);
+ $xfer += $input->readString($val27);
+ $this->operatorAttributes[$key26] = $val27;
+ }
+ $xfer += $input->readMapEnd();
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
+ case 4:
+ if ($ftype == TType::MAP) {
+ $this->operatorCounters = array();
+ $_size28 = 0;
+ $_ktype29 = 0;
+ $_vtype30 = 0;
+ $xfer += $input->readMapBegin($_ktype29, $_vtype30, $_size28);
+ for ($_i32 = 0; $_i32 < $_size28; ++$_i32)
+ {
+ $key33 = '';
+ $val34 = 0;
+ $xfer += $input->readString($key33);
+ $xfer += $input->readI64($val34);
+ $this->operatorCounters[$key33] = $val34;
+ }
+ $xfer += $input->readMapEnd();
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
+ case 5:
+ if ($ftype == TType::BOOL) {
+ $xfer += $input->readBool($this->done);
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
+ case 6:
+ if ($ftype == TType::BOOL) {
+ $xfer += $input->readBool($this->started);
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
+ default:
+ $xfer += $input->skip($ftype);
+ break;
+ }
+ $xfer += $input->readFieldEnd();
+ }
+ $xfer += $input->readStructEnd();
+ return $xfer;
+ }
+
+ public function write($output) {
+ $xfer = 0;
+ $xfer += $output->writeStructBegin('Operator');
+ if ($this->operatorId !== null) {
+ $xfer += $output->writeFieldBegin('operatorId', TType::STRING, 1);
+ $xfer += $output->writeString($this->operatorId);
+ $xfer += $output->writeFieldEnd();
+ }
+ if ($this->operatorType !== null) {
+ $xfer += $output->writeFieldBegin('operatorType', TType::I32, 2);
+ $xfer += $output->writeI32($this->operatorType);
+ $xfer += $output->writeFieldEnd();
+ }
+ if ($this->operatorAttributes !== null) {
+ if (!is_array($this->operatorAttributes)) {
+ throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
+ }
+ $xfer += $output->writeFieldBegin('operatorAttributes', TType::MAP, 3);
+ {
+ $output->writeMapBegin(TType::STRING, TType::STRING, count($this->operatorAttributes));
+ {
+ foreach ($this->operatorAttributes as $kiter35 => $viter36)
+ {
+ $xfer += $output->writeString($kiter35);
+ $xfer += $output->writeString($viter36);
+ }
+ }
+ $output->writeMapEnd();
+ }
+ $xfer += $output->writeFieldEnd();
+ }
+ if ($this->operatorCounters !== null) {
+ if (!is_array($this->operatorCounters)) {
+ throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
+ }
+ $xfer += $output->writeFieldBegin('operatorCounters', TType::MAP, 4);
+ {
+ $output->writeMapBegin(TType::STRING, TType::I64, count($this->operatorCounters));
+ {
+ foreach ($this->operatorCounters as $kiter37 => $viter38)
+ {
+ $xfer += $output->writeString($kiter37);
+ $xfer += $output->writeI64($viter38);
+ }
+ }
+ $output->writeMapEnd();
+ }
+ $xfer += $output->writeFieldEnd();
+ }
+ if ($this->done !== null) {
+ $xfer += $output->writeFieldBegin('done', TType::BOOL, 5);
+ $xfer += $output->writeBool($this->done);
+ $xfer += $output->writeFieldEnd();
+ }
+ if ($this->started !== null) {
+ $xfer += $output->writeFieldBegin('started', TType::BOOL, 6);
+ $xfer += $output->writeBool($this->started);
+ $xfer += $output->writeFieldEnd();
+ }
+ $xfer += $output->writeFieldStop();
+ $xfer += $output->writeStructEnd();
+ return $xfer;
+ }
+
+}
+
+class Task {
+ static $_TSPEC;
+
+ public $taskId = null;
+ public $taskType = null;
+ public $taskAttributes = null;
+ public $taskCounters = null;
+ public $operatorGraph = null;
+ public $operatorList = null;
+ public $done = null;
+ public $started = null;
+
+ public function __construct($vals=null) {
+ if (!isset(self::$_TSPEC)) {
+ self::$_TSPEC = array(
+ 1 => array(
+ 'var' => 'taskId',
+ 'type' => TType::STRING,
+ ),
+ 2 => array(
+ 'var' => 'taskType',
+ 'type' => TType::I32,
+ ),
+ 3 => array(
+ 'var' => 'taskAttributes',
+ 'type' => TType::MAP,
+ 'ktype' => TType::STRING,
+ 'vtype' => TType::STRING,
+ 'key' => array(
+ 'type' => TType::STRING,
+ ),
+ 'val' => array(
+ 'type' => TType::STRING,
+ ),
+ ),
+ 4 => array(
+ 'var' => 'taskCounters',
+ 'type' => TType::MAP,
+ 'ktype' => TType::STRING,
+ 'vtype' => TType::I64,
+ 'key' => array(
+ 'type' => TType::STRING,
+ ),
+ 'val' => array(
+ 'type' => TType::I64,
+ ),
+ ),
+ 5 => array(
+ 'var' => 'operatorGraph',
+ 'type' => TType::STRUCT,
+ 'class' => 'Graph',
+ ),
+ 6 => array(
+ 'var' => 'operatorList',
+ 'type' => TType::LST,
+ 'etype' => TType::STRUCT,
+ 'elem' => array(
+ 'type' => TType::STRUCT,
+ 'class' => 'Operator',
+ ),
+ ),
+ 7 => array(
+ 'var' => 'done',
+ 'type' => TType::BOOL,
+ ),
+ 8 => array(
+ 'var' => 'started',
+ 'type' => TType::BOOL,
+ ),
+ );
+ }
+ if (is_array($vals)) {
+ if (isset($vals['taskId'])) {
+ $this->taskId = $vals['taskId'];
+ }
+ if (isset($vals['taskType'])) {
+ $this->taskType = $vals['taskType'];
+ }
+ if (isset($vals['taskAttributes'])) {
+ $this->taskAttributes = $vals['taskAttributes'];
+ }
+ if (isset($vals['taskCounters'])) {
+ $this->taskCounters = $vals['taskCounters'];
+ }
+ if (isset($vals['operatorGraph'])) {
+ $this->operatorGraph = $vals['operatorGraph'];
+ }
+ if (isset($vals['operatorList'])) {
+ $this->operatorList = $vals['operatorList'];
+ }
+ if (isset($vals['done'])) {
+ $this->done = $vals['done'];
+ }
+ if (isset($vals['started'])) {
+ $this->started = $vals['started'];
+ }
+ }
+ }
+
+ public function getName() {
+ return 'Task';
+ }
+
+ public function read($input)
+ {
+ $xfer = 0;
+ $fname = null;
+ $ftype = 0;
+ $fid = 0;
+ $xfer += $input->readStructBegin($fname);
+ while (true)
+ {
+ $xfer += $input->readFieldBegin($fname, $ftype, $fid);
+ if ($ftype == TType::STOP) {
+ break;
+ }
+ switch ($fid)
+ {
+ case 1:
+ if ($ftype == TType::STRING) {
+ $xfer += $input->readString($this->taskId);
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
+ case 2:
+ if ($ftype == TType::I32) {
+ $xfer += $input->readI32($this->taskType);
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
+ case 3:
+ if ($ftype == TType::MAP) {
+ $this->taskAttributes = array();
+ $_size39 = 0;
+ $_ktype40 = 0;
+ $_vtype41 = 0;
+ $xfer += $input->readMapBegin($_ktype40, $_vtype41, $_size39);
+ for ($_i43 = 0; $_i43 < $_size39; ++$_i43)
+ {
+ $key44 = '';
+ $val45 = '';
+ $xfer += $input->readString($key44);
+ $xfer += $input->readString($val45);
+ $this->taskAttributes[$key44] = $val45;
+ }
+ $xfer += $input->readMapEnd();
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
+ case 4:
+ if ($ftype == TType::MAP) {
+ $this->taskCounters = array();
+ $_size46 = 0;
+ $_ktype47 = 0;
+ $_vtype48 = 0;
+ $xfer += $input->readMapBegin($_ktype47, $_vtype48, $_size46);
+ for ($_i50 = 0; $_i50 < $_size46; ++$_i50)
+ {
+ $key51 = '';
+ $val52 = 0;
+ $xfer += $input->readString($key51);
+ $xfer += $input->readI64($val52);
+ $this->taskCounters[$key51] = $val52;
+ }
+ $xfer += $input->readMapEnd();
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
+ case 5:
+ if ($ftype == TType::STRUCT) {
+ $this->operatorGraph = new Graph();
+ $xfer += $this->operatorGraph->read($input);
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
+ case 6:
+ if ($ftype == TType::LST) {
+ $this->operatorList = array();
+ $_size53 = 0;
+ $_etype56 = 0;
+ $xfer += $input->readListBegin($_etype56, $_size53);
+ for ($_i57 = 0; $_i57 < $_size53; ++$_i57)
+ {
+ $elem58 = null;
+ $elem58 = new Operator();
+ $xfer += $elem58->read($input);
+ $this->operatorList []= $elem58;
+ }
+ $xfer += $input->readListEnd();
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
+ case 7:
+ if ($ftype == TType::BOOL) {
+ $xfer += $input->readBool($this->done);
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
+ case 8:
+ if ($ftype == TType::BOOL) {
+ $xfer += $input->readBool($this->started);
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
+ default:
+ $xfer += $input->skip($ftype);
+ break;
+ }
+ $xfer += $input->readFieldEnd();
+ }
+ $xfer += $input->readStructEnd();
+ return $xfer;
+ }
+
+ public function write($output) {
+ $xfer = 0;
+ $xfer += $output->writeStructBegin('Task');
+ if ($this->taskId !== null) {
+ $xfer += $output->writeFieldBegin('taskId', TType::STRING, 1);
+ $xfer += $output->writeString($this->taskId);
+ $xfer += $output->writeFieldEnd();
+ }
+ if ($this->taskType !== null) {
+ $xfer += $output->writeFieldBegin('taskType', TType::I32, 2);
+ $xfer += $output->writeI32($this->taskType);
+ $xfer += $output->writeFieldEnd();
+ }
+ if ($this->taskAttributes !== null) {
+ if (!is_array($this->taskAttributes)) {
+ throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
+ }
+ $xfer += $output->writeFieldBegin('taskAttributes', TType::MAP, 3);
+ {
+ $output->writeMapBegin(TType::STRING, TType::STRING, count($this->taskAttributes));
+ {
+ foreach ($this->taskAttributes as $kiter59 => $viter60)
+ {
+ $xfer += $output->writeString($kiter59);
+ $xfer += $output->writeString($viter60);
+ }
+ }
+ $output->writeMapEnd();
+ }
+ $xfer += $output->writeFieldEnd();
+ }
+ if ($this->taskCounters !== null) {
+ if (!is_array($this->taskCounters)) {
+ throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
+ }
+ $xfer += $output->writeFieldBegin('taskCounters', TType::MAP, 4);
+ {
+ $output->writeMapBegin(TType::STRING, TType::I64, count($this->taskCounters));
+ {
+ foreach ($this->taskCounters as $kiter61 => $viter62)
+ {
+ $xfer += $output->writeString($kiter61);
+ $xfer += $output->writeI64($viter62);
+ }
+ }
+ $output->writeMapEnd();
+ }
+ $xfer += $output->writeFieldEnd();
+ }
+ if ($this->operatorGraph !== null) {
+ if (!is_object($this->operatorGraph)) {
+ throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
+ }
+ $xfer += $output->writeFieldBegin('operatorGraph', TType::STRUCT, 5);
+ $xfer += $this->operatorGraph->write($output);
+ $xfer += $output->writeFieldEnd();
+ }
+ if ($this->operatorList !== null) {
+ if (!is_array($this->operatorList)) {
+ throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
+ }
+ $xfer += $output->writeFieldBegin('operatorList', TType::LST, 6);
+ {
+ $output->writeListBegin(TType::STRUCT, count($this->operatorList));
+ {
+ foreach ($this->operatorList as $iter63)
+ {
+ $xfer += $iter63->write($output);
+ }
+ }
+ $output->writeListEnd();
+ }
+ $xfer += $output->writeFieldEnd();
+ }
+ if ($this->done !== null) {
+ $xfer += $output->writeFieldBegin('done', TType::BOOL, 7);
+ $xfer += $output->writeBool($this->done);
+ $xfer += $output->writeFieldEnd();
+ }
+ if ($this->started !== null) {
+ $xfer += $output->writeFieldBegin('started', TType::BOOL, 8);
+ $xfer += $output->writeBool($this->started);
+ $xfer += $output->writeFieldEnd();
+ }
+ $xfer += $output->writeFieldStop();
+ $xfer += $output->writeStructEnd();
+ return $xfer;
+ }
+
+}
+
+class Stage {
+ static $_TSPEC;
+
+ public $stageId = null;
+ public $stageType = null;
+ public $stageAttributes = null;
+ public $stageCounters = null;
+ public $taskList = null;
+ public $done = null;
+ public $started = null;
+
+ public function __construct($vals=null) {
+ if (!isset(self::$_TSPEC)) {
+ self::$_TSPEC = array(
+ 1 => array(
+ 'var' => 'stageId',
+ 'type' => TType::STRING,
+ ),
+ 2 => array(
+ 'var' => 'stageType',
+ 'type' => TType::I32,
+ ),
+ 3 => array(
+ 'var' => 'stageAttributes',
+ 'type' => TType::MAP,
+ 'ktype' => TType::STRING,
+ 'vtype' => TType::STRING,
+ 'key' => array(
+ 'type' => TType::STRING,
+ ),
+ 'val' => array(
+ 'type' => TType::STRING,
+ ),
+ ),
+ 4 => array(
+ 'var' => 'stageCounters',
+ 'type' => TType::MAP,
+ 'ktype' => TType::STRING,
+ 'vtype' => TType::I64,
+ 'key' => array(
+ 'type' => TType::STRING,
+ ),
+ 'val' => array(
+ 'type' => TType::I64,
+ ),
+ ),
+ 5 => array(
+ 'var' => 'taskList',
+ 'type' => TType::LST,
+ 'etype' => TType::STRUCT,
+ 'elem' => array(
+ 'type' => TType::STRUCT,
+ 'class' => 'Task',
+ ),
+ ),
+ 6 => array(
+ 'var' => 'done',
+ 'type' => TType::BOOL,
+ ),
+ 7 => array(
+ 'var' => 'started',
+ 'type' => TType::BOOL,
+ ),
+ );
+ }
+ if (is_array($vals)) {
+ if (isset($vals['stageId'])) {
+ $this->stageId = $vals['stageId'];
+ }
+ if (isset($vals['stageType'])) {
+ $this->stageType = $vals['stageType'];
+ }
+ if (isset($vals['stageAttributes'])) {
+ $this->stageAttributes = $vals['stageAttributes'];
+ }
+ if (isset($vals['stageCounters'])) {
+ $this->stageCounters = $vals['stageCounters'];
+ }
+ if (isset($vals['taskList'])) {
+ $this->taskList = $vals['taskList'];
+ }
+ if (isset($vals['done'])) {
+ $this->done = $vals['done'];
+ }
+ if (isset($vals['started'])) {
+ $this->started = $vals['started'];
+ }
+ }
+ }
+
+ public function getName() {
+ return 'Stage';
+ }
+
+ public function read($input)
+ {
+ $xfer = 0;
+ $fname = null;
+ $ftype = 0;
+ $fid = 0;
+ $xfer += $input->readStructBegin($fname);
+ while (true)
+ {
+ $xfer += $input->readFieldBegin($fname, $ftype, $fid);
+ if ($ftype == TType::STOP) {
+ break;
+ }
+ switch ($fid)
+ {
+ case 1:
+ if ($ftype == TType::STRING) {
+ $xfer += $input->readString($this->stageId);
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
+ case 2:
+ if ($ftype == TType::I32) {
+ $xfer += $input->readI32($this->stageType);
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
+ case 3:
+ if ($ftype == TType::MAP) {
+ $this->stageAttributes = array();
+ $_size64 = 0;
+ $_ktype65 = 0;
+ $_vtype66 = 0;
+ $xfer += $input->readMapBegin($_ktype65, $_vtype66, $_size64);
+ for ($_i68 = 0; $_i68 < $_size64; ++$_i68)
+ {
+ $key69 = '';
+ $val70 = '';
+ $xfer += $input->readString($key69);
+ $xfer += $input->readString($val70);
+ $this->stageAttributes[$key69] = $val70;
+ }
+ $xfer += $input->readMapEnd();
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
+ case 4:
+ if ($ftype == TType::MAP) {
+ $this->stageCounters = array();
+ $_size71 = 0;
+ $_ktype72 = 0;
+ $_vtype73 = 0;
+ $xfer += $input->readMapBegin($_ktype72, $_vtype73, $_size71);
+ for ($_i75 = 0; $_i75 < $_size71; ++$_i75)
+ {
+ $key76 = '';
+ $val77 = 0;
+ $xfer += $input->readString($key76);
+ $xfer += $input->readI64($val77);
+ $this->stageCounters[$key76] = $val77;
+ }
+ $xfer += $input->readMapEnd();
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
+ case 5:
+ if ($ftype == TType::LST) {
+ $this->taskList = array();
+ $_size78 = 0;
+ $_etype81 = 0;
+ $xfer += $input->readListBegin($_etype81, $_size78);
+ for ($_i82 = 0; $_i82 < $_size78; ++$_i82)
+ {
+ $elem83 = null;
+ $elem83 = new Task();
+ $xfer += $elem83->read($input);
+ $this->taskList []= $elem83;
+ }
+ $xfer += $input->readListEnd();
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
+ case 6:
+ if ($ftype == TType::BOOL) {
+ $xfer += $input->readBool($this->done);
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
+ case 7:
+ if ($ftype == TType::BOOL) {
+ $xfer += $input->readBool($this->started);
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
+ default:
+ $xfer += $input->skip($ftype);
+ break;
+ }
+ $xfer += $input->readFieldEnd();
+ }
+ $xfer += $input->readStructEnd();
+ return $xfer;
+ }
+
+ public function write($output) {
+ $xfer = 0;
+ $xfer += $output->writeStructBegin('Stage');
+ if ($this->stageId !== null) {
+ $xfer += $output->writeFieldBegin('stageId', TType::STRING, 1);
+ $xfer += $output->writeString($this->stageId);
+ $xfer += $output->writeFieldEnd();
+ }
+ if ($this->stageType !== null) {
+ $xfer += $output->writeFieldBegin('stageType', TType::I32, 2);
+ $xfer += $output->writeI32($this->stageType);
+ $xfer += $output->writeFieldEnd();
+ }
+ if ($this->stageAttributes !== null) {
+ if (!is_array($this->stageAttributes)) {
+ throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
+ }
+ $xfer += $output->writeFieldBegin('stageAttributes', TType::MAP, 3);
+ {
+ $output->writeMapBegin(TType::STRING, TType::STRING, count($this->stageAttributes));
+ {
+ foreach ($this->stageAttributes as $kiter84 => $viter85)
+ {
+ $xfer += $output->writeString($kiter84);
+ $xfer += $output->writeString($viter85);
+ }
+ }
+ $output->writeMapEnd();
+ }
+ $xfer += $output->writeFieldEnd();
+ }
+ if ($this->stageCounters !== null) {
+ if (!is_array($this->stageCounters)) {
+ throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
+ }
+ $xfer += $output->writeFieldBegin('stageCounters', TType::MAP, 4);
+ {
+ $output->writeMapBegin(TType::STRING, TType::I64, count($this->stageCounters));
+ {
+ foreach ($this->stageCounters as $kiter86 => $viter87)
+ {
+ $xfer += $output->writeString($kiter86);
+ $xfer += $output->writeI64($viter87);
+ }
+ }
+ $output->writeMapEnd();
+ }
+ $xfer += $output->writeFieldEnd();
+ }
+ if ($this->taskList !== null) {
+ if (!is_array($this->taskList)) {
+ throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
+ }
+ $xfer += $output->writeFieldBegin('taskList', TType::LST, 5);
+ {
+ $output->writeListBegin(TType::STRUCT, count($this->taskList));
+ {
+ foreach ($this->taskList as $iter88)
+ {
+ $xfer += $iter88->write($output);
+ }
+ }
+ $output->writeListEnd();
+ }
+ $xfer += $output->writeFieldEnd();
+ }
+ if ($this->done !== null) {
+ $xfer += $output->writeFieldBegin('done', TType::BOOL, 6);
+ $xfer += $output->writeBool($this->done);
+ $xfer += $output->writeFieldEnd();
+ }
+ if ($this->started !== null) {
+ $xfer += $output->writeFieldBegin('started', TType::BOOL, 7);
+ $xfer += $output->writeBool($this->started);
+ $xfer += $output->writeFieldEnd();
+ }
+ $xfer += $output->writeFieldStop();
+ $xfer += $output->writeStructEnd();
+ return $xfer;
+ }
+
+}
+
+class Query {
+ static $_TSPEC;
+
+ public $queryId = null;
+ public $queryType = null;
+ public $queryAttributes = null;
+ public $queryCounters = null;
+ public $stageGraph = null;
+ public $stageList = null;
+ public $done = null;
+ public $started = null;
+
+ public function __construct($vals=null) {
+ if (!isset(self::$_TSPEC)) {
+ self::$_TSPEC = array(
+ 1 => array(
+ 'var' => 'queryId',
+ 'type' => TType::STRING,
+ ),
+ 2 => array(
+ 'var' => 'queryType',
+ 'type' => TType::STRING,
+ ),
+ 3 => array(
+ 'var' => 'queryAttributes',
+ 'type' => TType::MAP,
+ 'ktype' => TType::STRING,
+ 'vtype' => TType::STRING,
+ 'key' => array(
+ 'type' => TType::STRING,
+ ),
+ 'val' => array(
+ 'type' => TType::STRING,
+ ),
+ ),
+ 4 => array(
+ 'var' => 'queryCounters',
+ 'type' => TType::MAP,
+ 'ktype' => TType::STRING,
+ 'vtype' => TType::I64,
+ 'key' => array(
+ 'type' => TType::STRING,
+ ),
+ 'val' => array(
+ 'type' => TType::I64,
+ ),
+ ),
+ 5 => array(
+ 'var' => 'stageGraph',
+ 'type' => TType::STRUCT,
+ 'class' => 'Graph',
+ ),
+ 6 => array(
+ 'var' => 'stageList',
+ 'type' => TType::LST,
+ 'etype' => TType::STRUCT,
+ 'elem' => array(
+ 'type' => TType::STRUCT,
+ 'class' => 'Stage',
+ ),
+ ),
+ 7 => array(
+ 'var' => 'done',
+ 'type' => TType::BOOL,
+ ),
+ 8 => array(
+ 'var' => 'started',
+ 'type' => TType::BOOL,
+ ),
+ );
+ }
+ if (is_array($vals)) {
+ if (isset($vals['queryId'])) {
+ $this->queryId = $vals['queryId'];
+ }
+ if (isset($vals['queryType'])) {
+ $this->queryType = $vals['queryType'];
+ }
+ if (isset($vals['queryAttributes'])) {
+ $this->queryAttributes = $vals['queryAttributes'];
+ }
+ if (isset($vals['queryCounters'])) {
+ $this->queryCounters = $vals['queryCounters'];
+ }
+ if (isset($vals['stageGraph'])) {
+ $this->stageGraph = $vals['stageGraph'];
+ }
+ if (isset($vals['stageList'])) {
+ $this->stageList = $vals['stageList'];
+ }
+ if (isset($vals['done'])) {
+ $this->done = $vals['done'];
+ }
+ if (isset($vals['started'])) {
+ $this->started = $vals['started'];
+ }
+ }
+ }
+
+ public function getName() {
+ return 'Query';
+ }
+
+ public function read($input)
+ {
+ $xfer = 0;
+ $fname = null;
+ $ftype = 0;
+ $fid = 0;
+ $xfer += $input->readStructBegin($fname);
+ while (true)
+ {
+ $xfer += $input->readFieldBegin($fname, $ftype, $fid);
+ if ($ftype == TType::STOP) {
+ break;
+ }
+ switch ($fid)
+ {
+ case 1:
+ if ($ftype == TType::STRING) {
+ $xfer += $input->readString($this->queryId);
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
+ case 2:
+ if ($ftype == TType::STRING) {
+ $xfer += $input->readString($this->queryType);
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
+ case 3:
+ if ($ftype == TType::MAP) {
+ $this->queryAttributes = array();
+ $_size89 = 0;
+ $_ktype90 = 0;
+ $_vtype91 = 0;
+ $xfer += $input->readMapBegin($_ktype90, $_vtype91, $_size89);
+ for ($_i93 = 0; $_i93 < $_size89; ++$_i93)
+ {
+ $key94 = '';
+ $val95 = '';
+ $xfer += $input->readString($key94);
+ $xfer += $input->readString($val95);
+ $this->queryAttributes[$key94] = $val95;
+ }
+ $xfer += $input->readMapEnd();
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
+ case 4:
+ if ($ftype == TType::MAP) {
+ $this->queryCounters = array();
+ $_size96 = 0;
+ $_ktype97 = 0;
+ $_vtype98 = 0;
+ $xfer += $input->readMapBegin($_ktype97, $_vtype98, $_size96);
+ for ($_i100 = 0; $_i100 < $_size96; ++$_i100)
+ {
+ $key101 = '';
+ $val102 = 0;
+ $xfer += $input->readString($key101);
+ $xfer += $input->readI64($val102);
+ $this->queryCounters[$key101] = $val102;
+ }
+ $xfer += $input->readMapEnd();
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
+ case 5:
+ if ($ftype == TType::STRUCT) {
+ $this->stageGraph = new Graph();
+ $xfer += $this->stageGraph->read($input);
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
+ case 6:
+ if ($ftype == TType::LST) {
+ $this->stageList = array();
+ $_size103 = 0;
+ $_etype106 = 0;
+ $xfer += $input->readListBegin($_etype106, $_size103);
+ for ($_i107 = 0; $_i107 < $_size103; ++$_i107)
+ {
+ $elem108 = null;
+ $elem108 = new Stage();
+ $xfer += $elem108->read($input);
+ $this->stageList []= $elem108;
+ }
+ $xfer += $input->readListEnd();
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
+ case 7:
+ if ($ftype == TType::BOOL) {
+ $xfer += $input->readBool($this->done);
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
+ case 8:
+ if ($ftype == TType::BOOL) {
+ $xfer += $input->readBool($this->started);
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
+ default:
+ $xfer += $input->skip($ftype);
+ break;
+ }
+ $xfer += $input->readFieldEnd();
+ }
+ $xfer += $input->readStructEnd();
+ return $xfer;
+ }
+
+ public function write($output) {
+ $xfer = 0;
+ $xfer += $output->writeStructBegin('Query');
+ if ($this->queryId !== null) {
+ $xfer += $output->writeFieldBegin('queryId', TType::STRING, 1);
+ $xfer += $output->writeString($this->queryId);
+ $xfer += $output->writeFieldEnd();
+ }
+ if ($this->queryType !== null) {
+ $xfer += $output->writeFieldBegin('queryType', TType::STRING, 2);
+ $xfer += $output->writeString($this->queryType);
+ $xfer += $output->writeFieldEnd();
+ }
+ if ($this->queryAttributes !== null) {
+ if (!is_array($this->queryAttributes)) {
+ throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
+ }
+ $xfer += $output->writeFieldBegin('queryAttributes', TType::MAP, 3);
+ {
+ $output->writeMapBegin(TType::STRING, TType::STRING, count($this->queryAttributes));
+ {
+ foreach ($this->queryAttributes as $kiter109 => $viter110)
+ {
+ $xfer += $output->writeString($kiter109);
+ $xfer += $output->writeString($viter110);
+ }
+ }
+ $output->writeMapEnd();
+ }
+ $xfer += $output->writeFieldEnd();
+ }
+ if ($this->queryCounters !== null) {
+ if (!is_array($this->queryCounters)) {
+ throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
+ }
+ $xfer += $output->writeFieldBegin('queryCounters', TType::MAP, 4);
+ {
+ $output->writeMapBegin(TType::STRING, TType::I64, count($this->queryCounters));
+ {
+ foreach ($this->queryCounters as $kiter111 => $viter112)
+ {
+ $xfer += $output->writeString($kiter111);
+ $xfer += $output->writeI64($viter112);
+ }
+ }
+ $output->writeMapEnd();
+ }
+ $xfer += $output->writeFieldEnd();
+ }
+ if ($this->stageGraph !== null) {
+ if (!is_object($this->stageGraph)) {
+ throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
+ }
+ $xfer += $output->writeFieldBegin('stageGraph', TType::STRUCT, 5);
+ $xfer += $this->stageGraph->write($output);
+ $xfer += $output->writeFieldEnd();
+ }
+ if ($this->stageList !== null) {
+ if (!is_array($this->stageList)) {
+ throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
+ }
+ $xfer += $output->writeFieldBegin('stageList', TType::LST, 6);
+ {
+ $output->writeListBegin(TType::STRUCT, count($this->stageList));
+ {
+ foreach ($this->stageList as $iter113)
+ {
+ $xfer += $iter113->write($output);
+ }
+ }
+ $output->writeListEnd();
+ }
+ $xfer += $output->writeFieldEnd();
+ }
+ if ($this->done !== null) {
+ $xfer += $output->writeFieldBegin('done', TType::BOOL, 7);
+ $xfer += $output->writeBool($this->done);
+ $xfer += $output->writeFieldEnd();
+ }
+ if ($this->started !== null) {
+ $xfer += $output->writeFieldBegin('started', TType::BOOL, 8);
+ $xfer += $output->writeBool($this->started);
+ $xfer += $output->writeFieldEnd();
+ }
+ $xfer += $output->writeFieldStop();
+ $xfer += $output->writeStructEnd();
+ return $xfer;
+ }
+
+}
+
+class QueryPlan {
+ static $_TSPEC;
+
+ public $queries = null;
+ public $done = null;
+ public $started = null;
+
+ public function __construct($vals=null) {
+ if (!isset(self::$_TSPEC)) {
+ self::$_TSPEC = array(
+ 1 => array(
+ 'var' => 'queries',
+ 'type' => TType::LST,
+ 'etype' => TType::STRUCT,
+ 'elem' => array(
+ 'type' => TType::STRUCT,
+ 'class' => 'Query',
+ ),
+ ),
+ 2 => array(
+ 'var' => 'done',
+ 'type' => TType::BOOL,
+ ),
+ 3 => array(
+ 'var' => 'started',
+ 'type' => TType::BOOL,
+ ),
+ );
+ }
+ if (is_array($vals)) {
+ if (isset($vals['queries'])) {
+ $this->queries = $vals['queries'];
+ }
+ if (isset($vals['done'])) {
+ $this->done = $vals['done'];
+ }
+ if (isset($vals['started'])) {
+ $this->started = $vals['started'];
+ }
+ }
+ }
+
+ public function getName() {
+ return 'QueryPlan';
+ }
+
+ public function read($input)
+ {
+ $xfer = 0;
+ $fname = null;
+ $ftype = 0;
+ $fid = 0;
+ $xfer += $input->readStructBegin($fname);
+ while (true)
+ {
+ $xfer += $input->readFieldBegin($fname, $ftype, $fid);
+ if ($ftype == TType::STOP) {
+ break;
+ }
+ switch ($fid)
+ {
+ case 1:
+ if ($ftype == TType::LST) {
+ $this->queries = array();
+ $_size114 = 0;
+ $_etype117 = 0;
+ $xfer += $input->readListBegin($_etype117, $_size114);
+ for ($_i118 = 0; $_i118 < $_size114; ++$_i118)
+ {
+ $elem119 = null;
+ $elem119 = new Query();
+ $xfer += $elem119->read($input);
+ $this->queries []= $elem119;
+ }
+ $xfer += $input->readListEnd();
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
+ case 2:
+ if ($ftype == TType::BOOL) {
+ $xfer += $input->readBool($this->done);
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
+ case 3:
+ if ($ftype == TType::BOOL) {
+ $xfer += $input->readBool($this->started);
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
+ default:
+ $xfer += $input->skip($ftype);
+ break;
+ }
+ $xfer += $input->readFieldEnd();
+ }
+ $xfer += $input->readStructEnd();
+ return $xfer;
+ }
+
+ public function write($output) {
+ $xfer = 0;
+ $xfer += $output->writeStructBegin('QueryPlan');
+ if ($this->queries !== null) {
+ if (!is_array($this->queries)) {
+ throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
+ }
+ $xfer += $output->writeFieldBegin('queries', TType::LST, 1);
+ {
+ $output->writeListBegin(TType::STRUCT, count($this->queries));
+ {
+ foreach ($this->queries as $iter120)
+ {
+ $xfer += $iter120->write($output);
+ }
+ }
+ $output->writeListEnd();
+ }
+ $xfer += $output->writeFieldEnd();
+ }
+ if ($this->done !== null) {
+ $xfer += $output->writeFieldBegin('done', TType::BOOL, 2);
+ $xfer += $output->writeBool($this->done);
+ $xfer += $output->writeFieldEnd();
+ }
+ if ($this->started !== null) {
+ $xfer += $output->writeFieldBegin('started', TType::BOOL, 3);
+ $xfer += $output->writeBool($this->started);
+ $xfer += $output->writeFieldEnd();
+ }
+ $xfer += $output->writeFieldStop();
+ $xfer += $output->writeStructEnd();
+ return $xfer;
+ }
+
+}
+
+?>
Added: hadoop/hive/trunk/ql/src/gen-py/queryplan/__init__.py
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/ql/src/gen-py/queryplan/__init__.py?rev=805973&view=auto
==============================================================================
--- hadoop/hive/trunk/ql/src/gen-py/queryplan/__init__.py (added)
+++ hadoop/hive/trunk/ql/src/gen-py/queryplan/__init__.py Wed Aug 19 21:02:57 2009
@@ -0,0 +1 @@
+__all__ = ['ttypes', 'constants']
Added: hadoop/hive/trunk/ql/src/gen-py/queryplan/constants.py
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/ql/src/gen-py/queryplan/constants.py?rev=805973&view=auto
==============================================================================
--- hadoop/hive/trunk/ql/src/gen-py/queryplan/constants.py (added)
+++ hadoop/hive/trunk/ql/src/gen-py/queryplan/constants.py Wed Aug 19 21:02:57 2009
@@ -0,0 +1,9 @@
+#
+# Autogenerated by Thrift
+#
+# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+#
+
+from thrift.Thrift import *
+from ttypes import *
+
Added: hadoop/hive/trunk/ql/src/gen-py/queryplan/ttypes.py
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/ql/src/gen-py/queryplan/ttypes.py?rev=805973&view=auto
==============================================================================
--- hadoop/hive/trunk/ql/src/gen-py/queryplan/ttypes.py (added)
+++ hadoop/hive/trunk/ql/src/gen-py/queryplan/ttypes.py Wed Aug 19 21:02:57 2009
@@ -0,0 +1,962 @@
+#
+# Autogenerated by Thrift
+#
+# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+#
+
+from thrift.Thrift import *
+
+from thrift.transport import TTransport
+from thrift.protocol import TBinaryProtocol
+try:
+ from thrift.protocol import fastbinary
+except:
+ fastbinary = None
+
+
+class AdjacencyType:
+ CONJUNCTIVE = 0
+ DISJUNCTIVE = 1
+
+class NodeType:
+ OPERATOR = 0
+ STAGE = 1
+
+class OperatorType:
+ JOIN = 0
+ MAPJOIN = 1
+ EXTRACT = 2
+ FILTER = 3
+ FORWARD = 4
+ GROUPBY = 5
+ LIMIT = 6
+ SCRIPT = 7
+ SELECT = 8
+ TABLESCAN = 9
+ FILESINK = 10
+ REDUCESINK = 11
+ UNION = 12
+
+class TaskType:
+ MAP = 0
+ REDUCE = 1
+ OTHER = 2
+
+class StageType:
+ CONDITIONAL = 0
+ COPY = 1
+ DDL = 2
+ MAPRED = 3
+ EXPLAIN = 4
+ FETCH = 5
+ FUNC = 6
+ MAPREDLOCAL = 7
+ MOVE = 8
+
+class Adjacency:
+ """
+ Attributes:
+ - node
+ - children
+ - adjacencyType
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.STRING, 'node', None, None, ), # 1
+ (2, TType.LIST, 'children', (TType.STRING,None), None, ), # 2
+ (3, TType.I32, 'adjacencyType', None, None, ), # 3
+ )
+
+ def __init__(self, node=None, children=None, adjacencyType=None,):
+ self.node = node
+ self.children = children
+ self.adjacencyType = adjacencyType
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.STRING:
+ self.node = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.LIST:
+ self.children = []
+ (_etype3, _size0) = iprot.readListBegin()
+ for _i4 in xrange(_size0):
+ _elem5 = iprot.readString();
+ self.children.append(_elem5)
+ iprot.readListEnd()
+ else:
+ iprot.skip(ftype)
+ elif fid == 3:
+ if ftype == TType.I32:
+ self.adjacencyType = iprot.readI32();
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('Adjacency')
+ if self.node != None:
+ oprot.writeFieldBegin('node', TType.STRING, 1)
+ oprot.writeString(self.node)
+ oprot.writeFieldEnd()
+ if self.children != None:
+ oprot.writeFieldBegin('children', TType.LIST, 2)
+ oprot.writeListBegin(TType.STRING, len(self.children))
+ for iter6 in self.children:
+ oprot.writeString(iter6)
+ oprot.writeListEnd()
+ oprot.writeFieldEnd()
+ if self.adjacencyType != None:
+ oprot.writeFieldBegin('adjacencyType', TType.I32, 3)
+ oprot.writeI32(self.adjacencyType)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class Graph:
+ """
+ Attributes:
+ - nodeType
+ - roots
+ - adjacencyList
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.I32, 'nodeType', None, None, ), # 1
+ (2, TType.LIST, 'roots', (TType.STRING,None), None, ), # 2
+ (3, TType.LIST, 'adjacencyList', (TType.STRUCT,(Adjacency, Adjacency.thrift_spec)), None, ), # 3
+ )
+
+ def __init__(self, nodeType=None, roots=None, adjacencyList=None,):
+ self.nodeType = nodeType
+ self.roots = roots
+ self.adjacencyList = adjacencyList
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.I32:
+ self.nodeType = iprot.readI32();
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.LIST:
+ self.roots = []
+ (_etype10, _size7) = iprot.readListBegin()
+ for _i11 in xrange(_size7):
+ _elem12 = iprot.readString();
+ self.roots.append(_elem12)
+ iprot.readListEnd()
+ else:
+ iprot.skip(ftype)
+ elif fid == 3:
+ if ftype == TType.LIST:
+ self.adjacencyList = []
+ (_etype16, _size13) = iprot.readListBegin()
+ for _i17 in xrange(_size13):
+ _elem18 = Adjacency()
+ _elem18.read(iprot)
+ self.adjacencyList.append(_elem18)
+ iprot.readListEnd()
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('Graph')
+ if self.nodeType != None:
+ oprot.writeFieldBegin('nodeType', TType.I32, 1)
+ oprot.writeI32(self.nodeType)
+ oprot.writeFieldEnd()
+ if self.roots != None:
+ oprot.writeFieldBegin('roots', TType.LIST, 2)
+ oprot.writeListBegin(TType.STRING, len(self.roots))
+ for iter19 in self.roots:
+ oprot.writeString(iter19)
+ oprot.writeListEnd()
+ oprot.writeFieldEnd()
+ if self.adjacencyList != None:
+ oprot.writeFieldBegin('adjacencyList', TType.LIST, 3)
+ oprot.writeListBegin(TType.STRUCT, len(self.adjacencyList))
+ for iter20 in self.adjacencyList:
+ iter20.write(oprot)
+ oprot.writeListEnd()
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class Operator:
+ """
+ Attributes:
+ - operatorId
+ - operatorType
+ - operatorAttributes
+ - operatorCounters
+ - done
+ - started
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.STRING, 'operatorId', None, None, ), # 1
+ (2, TType.I32, 'operatorType', None, None, ), # 2
+ (3, TType.MAP, 'operatorAttributes', (TType.STRING,None,TType.STRING,None), None, ), # 3
+ (4, TType.MAP, 'operatorCounters', (TType.STRING,None,TType.I64,None), None, ), # 4
+ (5, TType.BOOL, 'done', None, None, ), # 5
+ (6, TType.BOOL, 'started', None, None, ), # 6
+ )
+
+ def __init__(self, operatorId=None, operatorType=None, operatorAttributes=None, operatorCounters=None, done=None, started=None,):
+ self.operatorId = operatorId
+ self.operatorType = operatorType
+ self.operatorAttributes = operatorAttributes
+ self.operatorCounters = operatorCounters
+ self.done = done
+ self.started = started
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.STRING:
+ self.operatorId = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.I32:
+ self.operatorType = iprot.readI32();
+ else:
+ iprot.skip(ftype)
+ elif fid == 3:
+ if ftype == TType.MAP:
+ self.operatorAttributes = {}
+ (_ktype22, _vtype23, _size21 ) = iprot.readMapBegin()
+ for _i25 in xrange(_size21):
+ _key26 = iprot.readString();
+ _val27 = iprot.readString();
+ self.operatorAttributes[_key26] = _val27
+ iprot.readMapEnd()
+ else:
+ iprot.skip(ftype)
+ elif fid == 4:
+ if ftype == TType.MAP:
+ self.operatorCounters = {}
+ (_ktype29, _vtype30, _size28 ) = iprot.readMapBegin()
+ for _i32 in xrange(_size28):
+ _key33 = iprot.readString();
+ _val34 = iprot.readI64();
+ self.operatorCounters[_key33] = _val34
+ iprot.readMapEnd()
+ else:
+ iprot.skip(ftype)
+ elif fid == 5:
+ if ftype == TType.BOOL:
+ self.done = iprot.readBool();
+ else:
+ iprot.skip(ftype)
+ elif fid == 6:
+ if ftype == TType.BOOL:
+ self.started = iprot.readBool();
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('Operator')
+ if self.operatorId != None:
+ oprot.writeFieldBegin('operatorId', TType.STRING, 1)
+ oprot.writeString(self.operatorId)
+ oprot.writeFieldEnd()
+ if self.operatorType != None:
+ oprot.writeFieldBegin('operatorType', TType.I32, 2)
+ oprot.writeI32(self.operatorType)
+ oprot.writeFieldEnd()
+ if self.operatorAttributes != None:
+ oprot.writeFieldBegin('operatorAttributes', TType.MAP, 3)
+ oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.operatorAttributes))
+ for kiter35,viter36 in self.operatorAttributes.items():
+ oprot.writeString(kiter35)
+ oprot.writeString(viter36)
+ oprot.writeMapEnd()
+ oprot.writeFieldEnd()
+ if self.operatorCounters != None:
+ oprot.writeFieldBegin('operatorCounters', TType.MAP, 4)
+ oprot.writeMapBegin(TType.STRING, TType.I64, len(self.operatorCounters))
+ for kiter37,viter38 in self.operatorCounters.items():
+ oprot.writeString(kiter37)
+ oprot.writeI64(viter38)
+ oprot.writeMapEnd()
+ oprot.writeFieldEnd()
+ if self.done != None:
+ oprot.writeFieldBegin('done', TType.BOOL, 5)
+ oprot.writeBool(self.done)
+ oprot.writeFieldEnd()
+ if self.started != None:
+ oprot.writeFieldBegin('started', TType.BOOL, 6)
+ oprot.writeBool(self.started)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class Task:
+ """
+ Attributes:
+ - taskId
+ - taskType
+ - taskAttributes
+ - taskCounters
+ - operatorGraph
+ - operatorList
+ - done
+ - started
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.STRING, 'taskId', None, None, ), # 1
+ (2, TType.I32, 'taskType', None, None, ), # 2
+ (3, TType.MAP, 'taskAttributes', (TType.STRING,None,TType.STRING,None), None, ), # 3
+ (4, TType.MAP, 'taskCounters', (TType.STRING,None,TType.I64,None), None, ), # 4
+ (5, TType.STRUCT, 'operatorGraph', (Graph, Graph.thrift_spec), None, ), # 5
+ (6, TType.LIST, 'operatorList', (TType.STRUCT,(Operator, Operator.thrift_spec)), None, ), # 6
+ (7, TType.BOOL, 'done', None, None, ), # 7
+ (8, TType.BOOL, 'started', None, None, ), # 8
+ )
+
+ def __init__(self, taskId=None, taskType=None, taskAttributes=None, taskCounters=None, operatorGraph=None, operatorList=None, done=None, started=None,):
+ self.taskId = taskId
+ self.taskType = taskType
+ self.taskAttributes = taskAttributes
+ self.taskCounters = taskCounters
+ self.operatorGraph = operatorGraph
+ self.operatorList = operatorList
+ self.done = done
+ self.started = started
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.STRING:
+ self.taskId = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.I32:
+ self.taskType = iprot.readI32();
+ else:
+ iprot.skip(ftype)
+ elif fid == 3:
+ if ftype == TType.MAP:
+ self.taskAttributes = {}
+ (_ktype40, _vtype41, _size39 ) = iprot.readMapBegin()
+ for _i43 in xrange(_size39):
+ _key44 = iprot.readString();
+ _val45 = iprot.readString();
+ self.taskAttributes[_key44] = _val45
+ iprot.readMapEnd()
+ else:
+ iprot.skip(ftype)
+ elif fid == 4:
+ if ftype == TType.MAP:
+ self.taskCounters = {}
+ (_ktype47, _vtype48, _size46 ) = iprot.readMapBegin()
+ for _i50 in xrange(_size46):
+ _key51 = iprot.readString();
+ _val52 = iprot.readI64();
+ self.taskCounters[_key51] = _val52
+ iprot.readMapEnd()
+ else:
+ iprot.skip(ftype)
+ elif fid == 5:
+ if ftype == TType.STRUCT:
+ self.operatorGraph = Graph()
+ self.operatorGraph.read(iprot)
+ else:
+ iprot.skip(ftype)
+ elif fid == 6:
+ if ftype == TType.LIST:
+ self.operatorList = []
+ (_etype56, _size53) = iprot.readListBegin()
+ for _i57 in xrange(_size53):
+ _elem58 = Operator()
+ _elem58.read(iprot)
+ self.operatorList.append(_elem58)
+ iprot.readListEnd()
+ else:
+ iprot.skip(ftype)
+ elif fid == 7:
+ if ftype == TType.BOOL:
+ self.done = iprot.readBool();
+ else:
+ iprot.skip(ftype)
+ elif fid == 8:
+ if ftype == TType.BOOL:
+ self.started = iprot.readBool();
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('Task')
+ if self.taskId != None:
+ oprot.writeFieldBegin('taskId', TType.STRING, 1)
+ oprot.writeString(self.taskId)
+ oprot.writeFieldEnd()
+ if self.taskType != None:
+ oprot.writeFieldBegin('taskType', TType.I32, 2)
+ oprot.writeI32(self.taskType)
+ oprot.writeFieldEnd()
+ if self.taskAttributes != None:
+ oprot.writeFieldBegin('taskAttributes', TType.MAP, 3)
+ oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.taskAttributes))
+ for kiter59,viter60 in self.taskAttributes.items():
+ oprot.writeString(kiter59)
+ oprot.writeString(viter60)
+ oprot.writeMapEnd()
+ oprot.writeFieldEnd()
+ if self.taskCounters != None:
+ oprot.writeFieldBegin('taskCounters', TType.MAP, 4)
+ oprot.writeMapBegin(TType.STRING, TType.I64, len(self.taskCounters))
+ for kiter61,viter62 in self.taskCounters.items():
+ oprot.writeString(kiter61)
+ oprot.writeI64(viter62)
+ oprot.writeMapEnd()
+ oprot.writeFieldEnd()
+ if self.operatorGraph != None:
+ oprot.writeFieldBegin('operatorGraph', TType.STRUCT, 5)
+ self.operatorGraph.write(oprot)
+ oprot.writeFieldEnd()
+ if self.operatorList != None:
+ oprot.writeFieldBegin('operatorList', TType.LIST, 6)
+ oprot.writeListBegin(TType.STRUCT, len(self.operatorList))
+ for iter63 in self.operatorList:
+ iter63.write(oprot)
+ oprot.writeListEnd()
+ oprot.writeFieldEnd()
+ if self.done != None:
+ oprot.writeFieldBegin('done', TType.BOOL, 7)
+ oprot.writeBool(self.done)
+ oprot.writeFieldEnd()
+ if self.started != None:
+ oprot.writeFieldBegin('started', TType.BOOL, 8)
+ oprot.writeBool(self.started)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class Stage:
+ """
+ Attributes:
+ - stageId
+ - stageType
+ - stageAttributes
+ - stageCounters
+ - taskList
+ - done
+ - started
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.STRING, 'stageId', None, None, ), # 1
+ (2, TType.I32, 'stageType', None, None, ), # 2
+ (3, TType.MAP, 'stageAttributes', (TType.STRING,None,TType.STRING,None), None, ), # 3
+ (4, TType.MAP, 'stageCounters', (TType.STRING,None,TType.I64,None), None, ), # 4
+ (5, TType.LIST, 'taskList', (TType.STRUCT,(Task, Task.thrift_spec)), None, ), # 5
+ (6, TType.BOOL, 'done', None, None, ), # 6
+ (7, TType.BOOL, 'started', None, None, ), # 7
+ )
+
+ def __init__(self, stageId=None, stageType=None, stageAttributes=None, stageCounters=None, taskList=None, done=None, started=None,):
+ self.stageId = stageId
+ self.stageType = stageType
+ self.stageAttributes = stageAttributes
+ self.stageCounters = stageCounters
+ self.taskList = taskList
+ self.done = done
+ self.started = started
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.STRING:
+ self.stageId = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.I32:
+ self.stageType = iprot.readI32();
+ else:
+ iprot.skip(ftype)
+ elif fid == 3:
+ if ftype == TType.MAP:
+ self.stageAttributes = {}
+ (_ktype65, _vtype66, _size64 ) = iprot.readMapBegin()
+ for _i68 in xrange(_size64):
+ _key69 = iprot.readString();
+ _val70 = iprot.readString();
+ self.stageAttributes[_key69] = _val70
+ iprot.readMapEnd()
+ else:
+ iprot.skip(ftype)
+ elif fid == 4:
+ if ftype == TType.MAP:
+ self.stageCounters = {}
+ (_ktype72, _vtype73, _size71 ) = iprot.readMapBegin()
+ for _i75 in xrange(_size71):
+ _key76 = iprot.readString();
+ _val77 = iprot.readI64();
+ self.stageCounters[_key76] = _val77
+ iprot.readMapEnd()
+ else:
+ iprot.skip(ftype)
+ elif fid == 5:
+ if ftype == TType.LIST:
+ self.taskList = []
+ (_etype81, _size78) = iprot.readListBegin()
+ for _i82 in xrange(_size78):
+ _elem83 = Task()
+ _elem83.read(iprot)
+ self.taskList.append(_elem83)
+ iprot.readListEnd()
+ else:
+ iprot.skip(ftype)
+ elif fid == 6:
+ if ftype == TType.BOOL:
+ self.done = iprot.readBool();
+ else:
+ iprot.skip(ftype)
+ elif fid == 7:
+ if ftype == TType.BOOL:
+ self.started = iprot.readBool();
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('Stage')
+ if self.stageId != None:
+ oprot.writeFieldBegin('stageId', TType.STRING, 1)
+ oprot.writeString(self.stageId)
+ oprot.writeFieldEnd()
+ if self.stageType != None:
+ oprot.writeFieldBegin('stageType', TType.I32, 2)
+ oprot.writeI32(self.stageType)
+ oprot.writeFieldEnd()
+ if self.stageAttributes != None:
+ oprot.writeFieldBegin('stageAttributes', TType.MAP, 3)
+ oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.stageAttributes))
+ for kiter84,viter85 in self.stageAttributes.items():
+ oprot.writeString(kiter84)
+ oprot.writeString(viter85)
+ oprot.writeMapEnd()
+ oprot.writeFieldEnd()
+ if self.stageCounters != None:
+ oprot.writeFieldBegin('stageCounters', TType.MAP, 4)
+ oprot.writeMapBegin(TType.STRING, TType.I64, len(self.stageCounters))
+ for kiter86,viter87 in self.stageCounters.items():
+ oprot.writeString(kiter86)
+ oprot.writeI64(viter87)
+ oprot.writeMapEnd()
+ oprot.writeFieldEnd()
+ if self.taskList != None:
+ oprot.writeFieldBegin('taskList', TType.LIST, 5)
+ oprot.writeListBegin(TType.STRUCT, len(self.taskList))
+ for iter88 in self.taskList:
+ iter88.write(oprot)
+ oprot.writeListEnd()
+ oprot.writeFieldEnd()
+ if self.done != None:
+ oprot.writeFieldBegin('done', TType.BOOL, 6)
+ oprot.writeBool(self.done)
+ oprot.writeFieldEnd()
+ if self.started != None:
+ oprot.writeFieldBegin('started', TType.BOOL, 7)
+ oprot.writeBool(self.started)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class Query:
+ """
+ Attributes:
+ - queryId
+ - queryType
+ - queryAttributes
+ - queryCounters
+ - stageGraph
+ - stageList
+ - done
+ - started
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.STRING, 'queryId', None, None, ), # 1
+ (2, TType.STRING, 'queryType', None, None, ), # 2
+ (3, TType.MAP, 'queryAttributes', (TType.STRING,None,TType.STRING,None), None, ), # 3
+ (4, TType.MAP, 'queryCounters', (TType.STRING,None,TType.I64,None), None, ), # 4
+ (5, TType.STRUCT, 'stageGraph', (Graph, Graph.thrift_spec), None, ), # 5
+ (6, TType.LIST, 'stageList', (TType.STRUCT,(Stage, Stage.thrift_spec)), None, ), # 6
+ (7, TType.BOOL, 'done', None, None, ), # 7
+ (8, TType.BOOL, 'started', None, None, ), # 8
+ )
+
+ def __init__(self, queryId=None, queryType=None, queryAttributes=None, queryCounters=None, stageGraph=None, stageList=None, done=None, started=None,):
+ self.queryId = queryId
+ self.queryType = queryType
+ self.queryAttributes = queryAttributes
+ self.queryCounters = queryCounters
+ self.stageGraph = stageGraph
+ self.stageList = stageList
+ self.done = done
+ self.started = started
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.STRING:
+ self.queryId = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.STRING:
+ self.queryType = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ elif fid == 3:
+ if ftype == TType.MAP:
+ self.queryAttributes = {}
+ (_ktype90, _vtype91, _size89 ) = iprot.readMapBegin()
+ for _i93 in xrange(_size89):
+ _key94 = iprot.readString();
+ _val95 = iprot.readString();
+ self.queryAttributes[_key94] = _val95
+ iprot.readMapEnd()
+ else:
+ iprot.skip(ftype)
+ elif fid == 4:
+ if ftype == TType.MAP:
+ self.queryCounters = {}
+ (_ktype97, _vtype98, _size96 ) = iprot.readMapBegin()
+ for _i100 in xrange(_size96):
+ _key101 = iprot.readString();
+ _val102 = iprot.readI64();
+ self.queryCounters[_key101] = _val102
+ iprot.readMapEnd()
+ else:
+ iprot.skip(ftype)
+ elif fid == 5:
+ if ftype == TType.STRUCT:
+ self.stageGraph = Graph()
+ self.stageGraph.read(iprot)
+ else:
+ iprot.skip(ftype)
+ elif fid == 6:
+ if ftype == TType.LIST:
+ self.stageList = []
+ (_etype106, _size103) = iprot.readListBegin()
+ for _i107 in xrange(_size103):
+ _elem108 = Stage()
+ _elem108.read(iprot)
+ self.stageList.append(_elem108)
+ iprot.readListEnd()
+ else:
+ iprot.skip(ftype)
+ elif fid == 7:
+ if ftype == TType.BOOL:
+ self.done = iprot.readBool();
+ else:
+ iprot.skip(ftype)
+ elif fid == 8:
+ if ftype == TType.BOOL:
+ self.started = iprot.readBool();
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('Query')
+ if self.queryId != None:
+ oprot.writeFieldBegin('queryId', TType.STRING, 1)
+ oprot.writeString(self.queryId)
+ oprot.writeFieldEnd()
+ if self.queryType != None:
+ oprot.writeFieldBegin('queryType', TType.STRING, 2)
+ oprot.writeString(self.queryType)
+ oprot.writeFieldEnd()
+ if self.queryAttributes != None:
+ oprot.writeFieldBegin('queryAttributes', TType.MAP, 3)
+ oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.queryAttributes))
+ for kiter109,viter110 in self.queryAttributes.items():
+ oprot.writeString(kiter109)
+ oprot.writeString(viter110)
+ oprot.writeMapEnd()
+ oprot.writeFieldEnd()
+ if self.queryCounters != None:
+ oprot.writeFieldBegin('queryCounters', TType.MAP, 4)
+ oprot.writeMapBegin(TType.STRING, TType.I64, len(self.queryCounters))
+ for kiter111,viter112 in self.queryCounters.items():
+ oprot.writeString(kiter111)
+ oprot.writeI64(viter112)
+ oprot.writeMapEnd()
+ oprot.writeFieldEnd()
+ if self.stageGraph != None:
+ oprot.writeFieldBegin('stageGraph', TType.STRUCT, 5)
+ self.stageGraph.write(oprot)
+ oprot.writeFieldEnd()
+ if self.stageList != None:
+ oprot.writeFieldBegin('stageList', TType.LIST, 6)
+ oprot.writeListBegin(TType.STRUCT, len(self.stageList))
+ for iter113 in self.stageList:
+ iter113.write(oprot)
+ oprot.writeListEnd()
+ oprot.writeFieldEnd()
+ if self.done != None:
+ oprot.writeFieldBegin('done', TType.BOOL, 7)
+ oprot.writeBool(self.done)
+ oprot.writeFieldEnd()
+ if self.started != None:
+ oprot.writeFieldBegin('started', TType.BOOL, 8)
+ oprot.writeBool(self.started)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class QueryPlan:
+ """
+ Attributes:
+ - queries
+ - done
+ - started
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.LIST, 'queries', (TType.STRUCT,(Query, Query.thrift_spec)), None, ), # 1
+ (2, TType.BOOL, 'done', None, None, ), # 2
+ (3, TType.BOOL, 'started', None, None, ), # 3
+ )
+
+ def __init__(self, queries=None, done=None, started=None,):
+ self.queries = queries
+ self.done = done
+ self.started = started
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.LIST:
+ self.queries = []
+ (_etype117, _size114) = iprot.readListBegin()
+ for _i118 in xrange(_size114):
+ _elem119 = Query()
+ _elem119.read(iprot)
+ self.queries.append(_elem119)
+ iprot.readListEnd()
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.BOOL:
+ self.done = iprot.readBool();
+ else:
+ iprot.skip(ftype)
+ elif fid == 3:
+ if ftype == TType.BOOL:
+ self.started = iprot.readBool();
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('QueryPlan')
+ if self.queries != None:
+ oprot.writeFieldBegin('queries', TType.LIST, 1)
+ oprot.writeListBegin(TType.STRUCT, len(self.queries))
+ for iter120 in self.queries:
+ iter120.write(oprot)
+ oprot.writeListEnd()
+ oprot.writeFieldEnd()
+ if self.done != None:
+ oprot.writeFieldBegin('done', TType.BOOL, 2)
+ oprot.writeBool(self.done)
+ oprot.writeFieldEnd()
+ if self.started != None:
+ oprot.writeFieldBegin('started', TType.BOOL, 3)
+ oprot.writeBool(self.started)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
Modified: hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/Driver.java
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/Driver.java?rev=805973&r1=805972&r2=805973&view=diff
==============================================================================
--- hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/Driver.java (original)
+++ hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/Driver.java Wed Aug 19 21:02:57 2009
@@ -119,7 +119,7 @@
if (!sem.getFetchTaskInit()) {
sem.setFetchTaskInit(true);
- sem.getFetchTask().initialize(conf);
+ sem.getFetchTask().initialize(conf, plan);
}
FetchTask ft = (FetchTask) sem.getFetchTask();
@@ -276,7 +276,7 @@
public QueryPlan getPlan() {
return plan;
}
-
+
public int run(String command) {
int ret = compile(command);
if (ret != 0)
@@ -305,7 +305,7 @@
return pehooks;
}
-
+
public int execute() {
boolean noName = StringUtils.isEmpty(conf
.getVar(HiveConf.ConfVars.HADOOPJOBNAME));
@@ -317,12 +317,15 @@
conf.setVar(HiveConf.ConfVars.HIVEQUERYID, queryId);
conf.setVar(HiveConf.ConfVars.HIVEQUERYSTRING, queryStr);
- try {
+ try {
LOG.info("Starting command: " + queryStr);
- if (SessionState.get() != null)
+ plan.setStarted();
+
+ if (SessionState.get() != null) {
SessionState.get().getHiveHistory().startQuery(queryStr, conf.getVar(HiveConf.ConfVars.HIVEQUERYID) );
-
+ SessionState.get().getHiveHistory().logPlanProgress(plan);
+ }
resStream = null;
BaseSemanticAnalyzer sem = plan.getPlan();
@@ -361,11 +364,10 @@
while (runnable.peek() != null) {
Task<? extends Serializable> tsk = runnable.remove();
-
- if (SessionState.get() != null)
+ if (SessionState.get() != null) {
SessionState.get().getHiveHistory().startTask(queryId, tsk,
tsk.getClass().getName());
-
+ }
if (tsk.isMapRedTask()) {
curJobNo++;
if (noName) {
@@ -374,9 +376,8 @@
}
}
- tsk.initialize(conf);
-
- int exitVal = tsk.execute();
+ tsk.initialize(conf, plan);
+ int exitVal = tsk.executeTask();
if (SessionState.get() != null) {
SessionState.get().getHiveHistory().setTaskProperty(queryId,
tsk.getId(), Keys.TASK_RET_CODE, String.valueOf(exitVal));
@@ -387,7 +388,6 @@
+ " from " + tsk.getClass().getName());
return 9;
}
- tsk.setDone();
if (tsk.getChildTasks() == null) {
continue;
@@ -417,13 +417,20 @@
+ org.apache.hadoop.util.StringUtils.stringifyException(e));
return (12);
} finally {
- if (SessionState.get() != null)
+ if (SessionState.get() != null) {
SessionState.get().getHiveHistory().endQuery(queryId);
+ }
if (noName) {
conf.setVar(HiveConf.ConfVars.HADOOPJOBNAME, "");
}
}
-
+ plan.setDone();
+ if (SessionState.get() != null) {
+ try {
+ SessionState.get().getHiveHistory().logPlanProgress(plan);
+ } catch (Exception e) {
+ }
+ }
console.printInfo("OK");
return (0);
}
@@ -433,7 +440,7 @@
BaseSemanticAnalyzer sem = plan.getPlan();
if (!sem.getFetchTaskInit()) {
sem.setFetchTaskInit(true);
- sem.getFetchTask().initialize(conf);
+ sem.getFetchTask().initialize(conf, plan);
}
FetchTask ft = (FetchTask) sem.getFetchTask();
ft.setMaxRows(maxRows);
@@ -493,4 +500,8 @@
return (0);
}
+
+ public org.apache.hadoop.hive.ql.plan.api.Query getQueryPlan() throws IOException {
+ return plan.getQueryPlan();
+ }
}