PageRenderTime 61ms CodeModel.GetById 2ms app.highlight 50ms RepoModel.GetById 1ms app.codeStats 1ms

/tags/release-0.1-rc2/hive/external/ql/src/gen/thrift/gen-php/queryplan/queryplan_types.php

#
PHP | 1753 lines | 1687 code | 61 blank | 5 comment | 264 complexity | 3733ba9f354ceaab042b9a0575cb0190 MD5 | raw file
   1<?php
   2/**
   3 * Autogenerated by Thrift
   4 *
   5 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
   6 */
   7include_once $GLOBALS['THRIFT_ROOT'].'/Thrift.php';
   8
   9
  10$GLOBALS['E_AdjacencyType'] = array(
  11  'CONJUNCTIVE' => 0,
  12  'DISJUNCTIVE' => 1,
  13);
  14
  15final class AdjacencyType {
  16  const CONJUNCTIVE = 0;
  17  const DISJUNCTIVE = 1;
  18  static public $__names = array(
  19    0 => 'CONJUNCTIVE',
  20    1 => 'DISJUNCTIVE',
  21  );
  22}
  23
  24$GLOBALS['E_NodeType'] = array(
  25  'OPERATOR' => 0,
  26  'STAGE' => 1,
  27);
  28
  29final class NodeType {
  30  const OPERATOR = 0;
  31  const STAGE = 1;
  32  static public $__names = array(
  33    0 => 'OPERATOR',
  34    1 => 'STAGE',
  35  );
  36}
  37
  38$GLOBALS['E_OperatorType'] = array(
  39  'JOIN' => 0,
  40  'MAPJOIN' => 1,
  41  'EXTRACT' => 2,
  42  'FILTER' => 3,
  43  'FORWARD' => 4,
  44  'GROUPBY' => 5,
  45  'LIMIT' => 6,
  46  'SCRIPT' => 7,
  47  'SELECT' => 8,
  48  'TABLESCAN' => 9,
  49  'FILESINK' => 10,
  50  'REDUCESINK' => 11,
  51  'UNION' => 12,
  52  'UDTF' => 13,
  53  'LATERALVIEWJOIN' => 14,
  54  'LATERALVIEWFORWARD' => 15,
  55  'HASHTABLESINK' => 16,
  56  'HASHTABLEDUMMY' => 17,
  57);
  58
  59final class OperatorType {
  60  const JOIN = 0;
  61  const MAPJOIN = 1;
  62  const EXTRACT = 2;
  63  const FILTER = 3;
  64  const FORWARD = 4;
  65  const GROUPBY = 5;
  66  const LIMIT = 6;
  67  const SCRIPT = 7;
  68  const SELECT = 8;
  69  const TABLESCAN = 9;
  70  const FILESINK = 10;
  71  const REDUCESINK = 11;
  72  const UNION = 12;
  73  const UDTF = 13;
  74  const LATERALVIEWJOIN = 14;
  75  const LATERALVIEWFORWARD = 15;
  76  const HASHTABLESINK = 16;
  77  const HASHTABLEDUMMY = 17;
  78  static public $__names = array(
  79    0 => 'JOIN',
  80    1 => 'MAPJOIN',
  81    2 => 'EXTRACT',
  82    3 => 'FILTER',
  83    4 => 'FORWARD',
  84    5 => 'GROUPBY',
  85    6 => 'LIMIT',
  86    7 => 'SCRIPT',
  87    8 => 'SELECT',
  88    9 => 'TABLESCAN',
  89    10 => 'FILESINK',
  90    11 => 'REDUCESINK',
  91    12 => 'UNION',
  92    13 => 'UDTF',
  93    14 => 'LATERALVIEWJOIN',
  94    15 => 'LATERALVIEWFORWARD',
  95    16 => 'HASHTABLESINK',
  96    17 => 'HASHTABLEDUMMY',
  97  );
  98}
  99
 100$GLOBALS['E_TaskType'] = array(
 101  'MAP' => 0,
 102  'REDUCE' => 1,
 103  'OTHER' => 2,
 104);
 105
 106final class TaskType {
 107  const MAP = 0;
 108  const REDUCE = 1;
 109  const OTHER = 2;
 110  static public $__names = array(
 111    0 => 'MAP',
 112    1 => 'REDUCE',
 113    2 => 'OTHER',
 114  );
 115}
 116
 117$GLOBALS['E_StageType'] = array(
 118  'CONDITIONAL' => 0,
 119  'COPY' => 1,
 120  'DDL' => 2,
 121  'MAPRED' => 3,
 122  'EXPLAIN' => 4,
 123  'FETCH' => 5,
 124  'FUNC' => 6,
 125  'MAPREDLOCAL' => 7,
 126  'MOVE' => 8,
 127  'STATS' => 9,
 128);
 129
 130final class StageType {
 131  const CONDITIONAL = 0;
 132  const COPY = 1;
 133  const DDL = 2;
 134  const MAPRED = 3;
 135  const EXPLAIN = 4;
 136  const FETCH = 5;
 137  const FUNC = 6;
 138  const MAPREDLOCAL = 7;
 139  const MOVE = 8;
 140  const STATS = 9;
 141  static public $__names = array(
 142    0 => 'CONDITIONAL',
 143    1 => 'COPY',
 144    2 => 'DDL',
 145    3 => 'MAPRED',
 146    4 => 'EXPLAIN',
 147    5 => 'FETCH',
 148    6 => 'FUNC',
 149    7 => 'MAPREDLOCAL',
 150    8 => 'MOVE',
 151    9 => 'STATS',
 152  );
 153}
 154
 155class Adjacency {
 156  static $_TSPEC;
 157
 158  public $node = null;
 159  public $children = null;
 160  public $adjacencyType = null;
 161
 162  public function __construct($vals=null) {
 163    if (!isset(self::$_TSPEC)) {
 164      self::$_TSPEC = array(
 165        1 => array(
 166          'var' => 'node',
 167          'type' => TType::STRING,
 168          ),
 169        2 => array(
 170          'var' => 'children',
 171          'type' => TType::LST,
 172          'etype' => TType::STRING,
 173          'elem' => array(
 174            'type' => TType::STRING,
 175            ),
 176          ),
 177        3 => array(
 178          'var' => 'adjacencyType',
 179          'type' => TType::I32,
 180          ),
 181        );
 182    }
 183    if (is_array($vals)) {
 184      if (isset($vals['node'])) {
 185        $this->node = $vals['node'];
 186      }
 187      if (isset($vals['children'])) {
 188        $this->children = $vals['children'];
 189      }
 190      if (isset($vals['adjacencyType'])) {
 191        $this->adjacencyType = $vals['adjacencyType'];
 192      }
 193    }
 194  }
 195
 196  public function getName() {
 197    return 'Adjacency';
 198  }
 199
 200  public function read($input)
 201  {
 202    $xfer = 0;
 203    $fname = null;
 204    $ftype = 0;
 205    $fid = 0;
 206    $xfer += $input->readStructBegin($fname);
 207    while (true)
 208    {
 209      $xfer += $input->readFieldBegin($fname, $ftype, $fid);
 210      if ($ftype == TType::STOP) {
 211        break;
 212      }
 213      switch ($fid)
 214      {
 215        case 1:
 216          if ($ftype == TType::STRING) {
 217            $xfer += $input->readString($this->node);
 218          } else {
 219            $xfer += $input->skip($ftype);
 220          }
 221          break;
 222        case 2:
 223          if ($ftype == TType::LST) {
 224            $this->children = array();
 225            $_size0 = 0;
 226            $_etype3 = 0;
 227            $xfer += $input->readListBegin($_etype3, $_size0);
 228            for ($_i4 = 0; $_i4 < $_size0; ++$_i4)
 229            {
 230              $elem5 = null;
 231              $xfer += $input->readString($elem5);
 232              $this->children []= $elem5;
 233            }
 234            $xfer += $input->readListEnd();
 235          } else {
 236            $xfer += $input->skip($ftype);
 237          }
 238          break;
 239        case 3:
 240          if ($ftype == TType::I32) {
 241            $xfer += $input->readI32($this->adjacencyType);
 242          } else {
 243            $xfer += $input->skip($ftype);
 244          }
 245          break;
 246        default:
 247          $xfer += $input->skip($ftype);
 248          break;
 249      }
 250      $xfer += $input->readFieldEnd();
 251    }
 252    $xfer += $input->readStructEnd();
 253    return $xfer;
 254  }
 255
 256  public function write($output) {
 257    $xfer = 0;
 258    $xfer += $output->writeStructBegin('Adjacency');
 259    if ($this->node !== null) {
 260      $xfer += $output->writeFieldBegin('node', TType::STRING, 1);
 261      $xfer += $output->writeString($this->node);
 262      $xfer += $output->writeFieldEnd();
 263    }
 264    if ($this->children !== null) {
 265      if (!is_array($this->children)) {
 266        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
 267      }
 268      $xfer += $output->writeFieldBegin('children', TType::LST, 2);
 269      {
 270        $output->writeListBegin(TType::STRING, count($this->children));
 271        {
 272          foreach ($this->children as $iter6)
 273          {
 274            $xfer += $output->writeString($iter6);
 275          }
 276        }
 277        $output->writeListEnd();
 278      }
 279      $xfer += $output->writeFieldEnd();
 280    }
 281    if ($this->adjacencyType !== null) {
 282      $xfer += $output->writeFieldBegin('adjacencyType', TType::I32, 3);
 283      $xfer += $output->writeI32($this->adjacencyType);
 284      $xfer += $output->writeFieldEnd();
 285    }
 286    $xfer += $output->writeFieldStop();
 287    $xfer += $output->writeStructEnd();
 288    return $xfer;
 289  }
 290
 291}
 292
 293class Graph {
 294  static $_TSPEC;
 295
 296  public $nodeType = null;
 297  public $roots = null;
 298  public $adjacencyList = null;
 299
 300  public function __construct($vals=null) {
 301    if (!isset(self::$_TSPEC)) {
 302      self::$_TSPEC = array(
 303        1 => array(
 304          'var' => 'nodeType',
 305          'type' => TType::I32,
 306          ),
 307        2 => array(
 308          'var' => 'roots',
 309          'type' => TType::LST,
 310          'etype' => TType::STRING,
 311          'elem' => array(
 312            'type' => TType::STRING,
 313            ),
 314          ),
 315        3 => array(
 316          'var' => 'adjacencyList',
 317          'type' => TType::LST,
 318          'etype' => TType::STRUCT,
 319          'elem' => array(
 320            'type' => TType::STRUCT,
 321            'class' => 'Adjacency',
 322            ),
 323          ),
 324        );
 325    }
 326    if (is_array($vals)) {
 327      if (isset($vals['nodeType'])) {
 328        $this->nodeType = $vals['nodeType'];
 329      }
 330      if (isset($vals['roots'])) {
 331        $this->roots = $vals['roots'];
 332      }
 333      if (isset($vals['adjacencyList'])) {
 334        $this->adjacencyList = $vals['adjacencyList'];
 335      }
 336    }
 337  }
 338
 339  public function getName() {
 340    return 'Graph';
 341  }
 342
 343  public function read($input)
 344  {
 345    $xfer = 0;
 346    $fname = null;
 347    $ftype = 0;
 348    $fid = 0;
 349    $xfer += $input->readStructBegin($fname);
 350    while (true)
 351    {
 352      $xfer += $input->readFieldBegin($fname, $ftype, $fid);
 353      if ($ftype == TType::STOP) {
 354        break;
 355      }
 356      switch ($fid)
 357      {
 358        case 1:
 359          if ($ftype == TType::I32) {
 360            $xfer += $input->readI32($this->nodeType);
 361          } else {
 362            $xfer += $input->skip($ftype);
 363          }
 364          break;
 365        case 2:
 366          if ($ftype == TType::LST) {
 367            $this->roots = array();
 368            $_size7 = 0;
 369            $_etype10 = 0;
 370            $xfer += $input->readListBegin($_etype10, $_size7);
 371            for ($_i11 = 0; $_i11 < $_size7; ++$_i11)
 372            {
 373              $elem12 = null;
 374              $xfer += $input->readString($elem12);
 375              $this->roots []= $elem12;
 376            }
 377            $xfer += $input->readListEnd();
 378          } else {
 379            $xfer += $input->skip($ftype);
 380          }
 381          break;
 382        case 3:
 383          if ($ftype == TType::LST) {
 384            $this->adjacencyList = array();
 385            $_size13 = 0;
 386            $_etype16 = 0;
 387            $xfer += $input->readListBegin($_etype16, $_size13);
 388            for ($_i17 = 0; $_i17 < $_size13; ++$_i17)
 389            {
 390              $elem18 = null;
 391              $elem18 = new Adjacency();
 392              $xfer += $elem18->read($input);
 393              $this->adjacencyList []= $elem18;
 394            }
 395            $xfer += $input->readListEnd();
 396          } else {
 397            $xfer += $input->skip($ftype);
 398          }
 399          break;
 400        default:
 401          $xfer += $input->skip($ftype);
 402          break;
 403      }
 404      $xfer += $input->readFieldEnd();
 405    }
 406    $xfer += $input->readStructEnd();
 407    return $xfer;
 408  }
 409
 410  public function write($output) {
 411    $xfer = 0;
 412    $xfer += $output->writeStructBegin('Graph');
 413    if ($this->nodeType !== null) {
 414      $xfer += $output->writeFieldBegin('nodeType', TType::I32, 1);
 415      $xfer += $output->writeI32($this->nodeType);
 416      $xfer += $output->writeFieldEnd();
 417    }
 418    if ($this->roots !== null) {
 419      if (!is_array($this->roots)) {
 420        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
 421      }
 422      $xfer += $output->writeFieldBegin('roots', TType::LST, 2);
 423      {
 424        $output->writeListBegin(TType::STRING, count($this->roots));
 425        {
 426          foreach ($this->roots as $iter19)
 427          {
 428            $xfer += $output->writeString($iter19);
 429          }
 430        }
 431        $output->writeListEnd();
 432      }
 433      $xfer += $output->writeFieldEnd();
 434    }
 435    if ($this->adjacencyList !== null) {
 436      if (!is_array($this->adjacencyList)) {
 437        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
 438      }
 439      $xfer += $output->writeFieldBegin('adjacencyList', TType::LST, 3);
 440      {
 441        $output->writeListBegin(TType::STRUCT, count($this->adjacencyList));
 442        {
 443          foreach ($this->adjacencyList as $iter20)
 444          {
 445            $xfer += $iter20->write($output);
 446          }
 447        }
 448        $output->writeListEnd();
 449      }
 450      $xfer += $output->writeFieldEnd();
 451    }
 452    $xfer += $output->writeFieldStop();
 453    $xfer += $output->writeStructEnd();
 454    return $xfer;
 455  }
 456
 457}
 458
 459class Operator {
 460  static $_TSPEC;
 461
 462  public $operatorId = null;
 463  public $operatorType = null;
 464  public $operatorAttributes = null;
 465  public $operatorCounters = null;
 466  public $done = null;
 467  public $started = null;
 468
 469  public function __construct($vals=null) {
 470    if (!isset(self::$_TSPEC)) {
 471      self::$_TSPEC = array(
 472        1 => array(
 473          'var' => 'operatorId',
 474          'type' => TType::STRING,
 475          ),
 476        2 => array(
 477          'var' => 'operatorType',
 478          'type' => TType::I32,
 479          ),
 480        3 => array(
 481          'var' => 'operatorAttributes',
 482          'type' => TType::MAP,
 483          'ktype' => TType::STRING,
 484          'vtype' => TType::STRING,
 485          'key' => array(
 486            'type' => TType::STRING,
 487          ),
 488          'val' => array(
 489            'type' => TType::STRING,
 490            ),
 491          ),
 492        4 => array(
 493          'var' => 'operatorCounters',
 494          'type' => TType::MAP,
 495          'ktype' => TType::STRING,
 496          'vtype' => TType::I64,
 497          'key' => array(
 498            'type' => TType::STRING,
 499          ),
 500          'val' => array(
 501            'type' => TType::I64,
 502            ),
 503          ),
 504        5 => array(
 505          'var' => 'done',
 506          'type' => TType::BOOL,
 507          ),
 508        6 => array(
 509          'var' => 'started',
 510          'type' => TType::BOOL,
 511          ),
 512        );
 513    }
 514    if (is_array($vals)) {
 515      if (isset($vals['operatorId'])) {
 516        $this->operatorId = $vals['operatorId'];
 517      }
 518      if (isset($vals['operatorType'])) {
 519        $this->operatorType = $vals['operatorType'];
 520      }
 521      if (isset($vals['operatorAttributes'])) {
 522        $this->operatorAttributes = $vals['operatorAttributes'];
 523      }
 524      if (isset($vals['operatorCounters'])) {
 525        $this->operatorCounters = $vals['operatorCounters'];
 526      }
 527      if (isset($vals['done'])) {
 528        $this->done = $vals['done'];
 529      }
 530      if (isset($vals['started'])) {
 531        $this->started = $vals['started'];
 532      }
 533    }
 534  }
 535
 536  public function getName() {
 537    return 'Operator';
 538  }
 539
 540  public function read($input)
 541  {
 542    $xfer = 0;
 543    $fname = null;
 544    $ftype = 0;
 545    $fid = 0;
 546    $xfer += $input->readStructBegin($fname);
 547    while (true)
 548    {
 549      $xfer += $input->readFieldBegin($fname, $ftype, $fid);
 550      if ($ftype == TType::STOP) {
 551        break;
 552      }
 553      switch ($fid)
 554      {
 555        case 1:
 556          if ($ftype == TType::STRING) {
 557            $xfer += $input->readString($this->operatorId);
 558          } else {
 559            $xfer += $input->skip($ftype);
 560          }
 561          break;
 562        case 2:
 563          if ($ftype == TType::I32) {
 564            $xfer += $input->readI32($this->operatorType);
 565          } else {
 566            $xfer += $input->skip($ftype);
 567          }
 568          break;
 569        case 3:
 570          if ($ftype == TType::MAP) {
 571            $this->operatorAttributes = array();
 572            $_size21 = 0;
 573            $_ktype22 = 0;
 574            $_vtype23 = 0;
 575            $xfer += $input->readMapBegin($_ktype22, $_vtype23, $_size21);
 576            for ($_i25 = 0; $_i25 < $_size21; ++$_i25)
 577            {
 578              $key26 = '';
 579              $val27 = '';
 580              $xfer += $input->readString($key26);
 581              $xfer += $input->readString($val27);
 582              $this->operatorAttributes[$key26] = $val27;
 583            }
 584            $xfer += $input->readMapEnd();
 585          } else {
 586            $xfer += $input->skip($ftype);
 587          }
 588          break;
 589        case 4:
 590          if ($ftype == TType::MAP) {
 591            $this->operatorCounters = array();
 592            $_size28 = 0;
 593            $_ktype29 = 0;
 594            $_vtype30 = 0;
 595            $xfer += $input->readMapBegin($_ktype29, $_vtype30, $_size28);
 596            for ($_i32 = 0; $_i32 < $_size28; ++$_i32)
 597            {
 598              $key33 = '';
 599              $val34 = 0;
 600              $xfer += $input->readString($key33);
 601              $xfer += $input->readI64($val34);
 602              $this->operatorCounters[$key33] = $val34;
 603            }
 604            $xfer += $input->readMapEnd();
 605          } else {
 606            $xfer += $input->skip($ftype);
 607          }
 608          break;
 609        case 5:
 610          if ($ftype == TType::BOOL) {
 611            $xfer += $input->readBool($this->done);
 612          } else {
 613            $xfer += $input->skip($ftype);
 614          }
 615          break;
 616        case 6:
 617          if ($ftype == TType::BOOL) {
 618            $xfer += $input->readBool($this->started);
 619          } else {
 620            $xfer += $input->skip($ftype);
 621          }
 622          break;
 623        default:
 624          $xfer += $input->skip($ftype);
 625          break;
 626      }
 627      $xfer += $input->readFieldEnd();
 628    }
 629    $xfer += $input->readStructEnd();
 630    return $xfer;
 631  }
 632
 633  public function write($output) {
 634    $xfer = 0;
 635    $xfer += $output->writeStructBegin('Operator');
 636    if ($this->operatorId !== null) {
 637      $xfer += $output->writeFieldBegin('operatorId', TType::STRING, 1);
 638      $xfer += $output->writeString($this->operatorId);
 639      $xfer += $output->writeFieldEnd();
 640    }
 641    if ($this->operatorType !== null) {
 642      $xfer += $output->writeFieldBegin('operatorType', TType::I32, 2);
 643      $xfer += $output->writeI32($this->operatorType);
 644      $xfer += $output->writeFieldEnd();
 645    }
 646    if ($this->operatorAttributes !== null) {
 647      if (!is_array($this->operatorAttributes)) {
 648        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
 649      }
 650      $xfer += $output->writeFieldBegin('operatorAttributes', TType::MAP, 3);
 651      {
 652        $output->writeMapBegin(TType::STRING, TType::STRING, count($this->operatorAttributes));
 653        {
 654          foreach ($this->operatorAttributes as $kiter35 => $viter36)
 655          {
 656            $xfer += $output->writeString($kiter35);
 657            $xfer += $output->writeString($viter36);
 658          }
 659        }
 660        $output->writeMapEnd();
 661      }
 662      $xfer += $output->writeFieldEnd();
 663    }
 664    if ($this->operatorCounters !== null) {
 665      if (!is_array($this->operatorCounters)) {
 666        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
 667      }
 668      $xfer += $output->writeFieldBegin('operatorCounters', TType::MAP, 4);
 669      {
 670        $output->writeMapBegin(TType::STRING, TType::I64, count($this->operatorCounters));
 671        {
 672          foreach ($this->operatorCounters as $kiter37 => $viter38)
 673          {
 674            $xfer += $output->writeString($kiter37);
 675            $xfer += $output->writeI64($viter38);
 676          }
 677        }
 678        $output->writeMapEnd();
 679      }
 680      $xfer += $output->writeFieldEnd();
 681    }
 682    if ($this->done !== null) {
 683      $xfer += $output->writeFieldBegin('done', TType::BOOL, 5);
 684      $xfer += $output->writeBool($this->done);
 685      $xfer += $output->writeFieldEnd();
 686    }
 687    if ($this->started !== null) {
 688      $xfer += $output->writeFieldBegin('started', TType::BOOL, 6);
 689      $xfer += $output->writeBool($this->started);
 690      $xfer += $output->writeFieldEnd();
 691    }
 692    $xfer += $output->writeFieldStop();
 693    $xfer += $output->writeStructEnd();
 694    return $xfer;
 695  }
 696
 697}
 698
 699class Task {
 700  static $_TSPEC;
 701
 702  public $taskId = null;
 703  public $taskType = null;
 704  public $taskAttributes = null;
 705  public $taskCounters = null;
 706  public $operatorGraph = null;
 707  public $operatorList = null;
 708  public $done = null;
 709  public $started = null;
 710
 711  public function __construct($vals=null) {
 712    if (!isset(self::$_TSPEC)) {
 713      self::$_TSPEC = array(
 714        1 => array(
 715          'var' => 'taskId',
 716          'type' => TType::STRING,
 717          ),
 718        2 => array(
 719          'var' => 'taskType',
 720          'type' => TType::I32,
 721          ),
 722        3 => array(
 723          'var' => 'taskAttributes',
 724          'type' => TType::MAP,
 725          'ktype' => TType::STRING,
 726          'vtype' => TType::STRING,
 727          'key' => array(
 728            'type' => TType::STRING,
 729          ),
 730          'val' => array(
 731            'type' => TType::STRING,
 732            ),
 733          ),
 734        4 => array(
 735          'var' => 'taskCounters',
 736          'type' => TType::MAP,
 737          'ktype' => TType::STRING,
 738          'vtype' => TType::I64,
 739          'key' => array(
 740            'type' => TType::STRING,
 741          ),
 742          'val' => array(
 743            'type' => TType::I64,
 744            ),
 745          ),
 746        5 => array(
 747          'var' => 'operatorGraph',
 748          'type' => TType::STRUCT,
 749          'class' => 'Graph',
 750          ),
 751        6 => array(
 752          'var' => 'operatorList',
 753          'type' => TType::LST,
 754          'etype' => TType::STRUCT,
 755          'elem' => array(
 756            'type' => TType::STRUCT,
 757            'class' => 'Operator',
 758            ),
 759          ),
 760        7 => array(
 761          'var' => 'done',
 762          'type' => TType::BOOL,
 763          ),
 764        8 => array(
 765          'var' => 'started',
 766          'type' => TType::BOOL,
 767          ),
 768        );
 769    }
 770    if (is_array($vals)) {
 771      if (isset($vals['taskId'])) {
 772        $this->taskId = $vals['taskId'];
 773      }
 774      if (isset($vals['taskType'])) {
 775        $this->taskType = $vals['taskType'];
 776      }
 777      if (isset($vals['taskAttributes'])) {
 778        $this->taskAttributes = $vals['taskAttributes'];
 779      }
 780      if (isset($vals['taskCounters'])) {
 781        $this->taskCounters = $vals['taskCounters'];
 782      }
 783      if (isset($vals['operatorGraph'])) {
 784        $this->operatorGraph = $vals['operatorGraph'];
 785      }
 786      if (isset($vals['operatorList'])) {
 787        $this->operatorList = $vals['operatorList'];
 788      }
 789      if (isset($vals['done'])) {
 790        $this->done = $vals['done'];
 791      }
 792      if (isset($vals['started'])) {
 793        $this->started = $vals['started'];
 794      }
 795    }
 796  }
 797
 798  public function getName() {
 799    return 'Task';
 800  }
 801
 802  public function read($input)
 803  {
 804    $xfer = 0;
 805    $fname = null;
 806    $ftype = 0;
 807    $fid = 0;
 808    $xfer += $input->readStructBegin($fname);
 809    while (true)
 810    {
 811      $xfer += $input->readFieldBegin($fname, $ftype, $fid);
 812      if ($ftype == TType::STOP) {
 813        break;
 814      }
 815      switch ($fid)
 816      {
 817        case 1:
 818          if ($ftype == TType::STRING) {
 819            $xfer += $input->readString($this->taskId);
 820          } else {
 821            $xfer += $input->skip($ftype);
 822          }
 823          break;
 824        case 2:
 825          if ($ftype == TType::I32) {
 826            $xfer += $input->readI32($this->taskType);
 827          } else {
 828            $xfer += $input->skip($ftype);
 829          }
 830          break;
 831        case 3:
 832          if ($ftype == TType::MAP) {
 833            $this->taskAttributes = array();
 834            $_size39 = 0;
 835            $_ktype40 = 0;
 836            $_vtype41 = 0;
 837            $xfer += $input->readMapBegin($_ktype40, $_vtype41, $_size39);
 838            for ($_i43 = 0; $_i43 < $_size39; ++$_i43)
 839            {
 840              $key44 = '';
 841              $val45 = '';
 842              $xfer += $input->readString($key44);
 843              $xfer += $input->readString($val45);
 844              $this->taskAttributes[$key44] = $val45;
 845            }
 846            $xfer += $input->readMapEnd();
 847          } else {
 848            $xfer += $input->skip($ftype);
 849          }
 850          break;
 851        case 4:
 852          if ($ftype == TType::MAP) {
 853            $this->taskCounters = array();
 854            $_size46 = 0;
 855            $_ktype47 = 0;
 856            $_vtype48 = 0;
 857            $xfer += $input->readMapBegin($_ktype47, $_vtype48, $_size46);
 858            for ($_i50 = 0; $_i50 < $_size46; ++$_i50)
 859            {
 860              $key51 = '';
 861              $val52 = 0;
 862              $xfer += $input->readString($key51);
 863              $xfer += $input->readI64($val52);
 864              $this->taskCounters[$key51] = $val52;
 865            }
 866            $xfer += $input->readMapEnd();
 867          } else {
 868            $xfer += $input->skip($ftype);
 869          }
 870          break;
 871        case 5:
 872          if ($ftype == TType::STRUCT) {
 873            $this->operatorGraph = new Graph();
 874            $xfer += $this->operatorGraph->read($input);
 875          } else {
 876            $xfer += $input->skip($ftype);
 877          }
 878          break;
 879        case 6:
 880          if ($ftype == TType::LST) {
 881            $this->operatorList = array();
 882            $_size53 = 0;
 883            $_etype56 = 0;
 884            $xfer += $input->readListBegin($_etype56, $_size53);
 885            for ($_i57 = 0; $_i57 < $_size53; ++$_i57)
 886            {
 887              $elem58 = null;
 888              $elem58 = new Operator();
 889              $xfer += $elem58->read($input);
 890              $this->operatorList []= $elem58;
 891            }
 892            $xfer += $input->readListEnd();
 893          } else {
 894            $xfer += $input->skip($ftype);
 895          }
 896          break;
 897        case 7:
 898          if ($ftype == TType::BOOL) {
 899            $xfer += $input->readBool($this->done);
 900          } else {
 901            $xfer += $input->skip($ftype);
 902          }
 903          break;
 904        case 8:
 905          if ($ftype == TType::BOOL) {
 906            $xfer += $input->readBool($this->started);
 907          } else {
 908            $xfer += $input->skip($ftype);
 909          }
 910          break;
 911        default:
 912          $xfer += $input->skip($ftype);
 913          break;
 914      }
 915      $xfer += $input->readFieldEnd();
 916    }
 917    $xfer += $input->readStructEnd();
 918    return $xfer;
 919  }
 920
 921  public function write($output) {
 922    $xfer = 0;
 923    $xfer += $output->writeStructBegin('Task');
 924    if ($this->taskId !== null) {
 925      $xfer += $output->writeFieldBegin('taskId', TType::STRING, 1);
 926      $xfer += $output->writeString($this->taskId);
 927      $xfer += $output->writeFieldEnd();
 928    }
 929    if ($this->taskType !== null) {
 930      $xfer += $output->writeFieldBegin('taskType', TType::I32, 2);
 931      $xfer += $output->writeI32($this->taskType);
 932      $xfer += $output->writeFieldEnd();
 933    }
 934    if ($this->taskAttributes !== null) {
 935      if (!is_array($this->taskAttributes)) {
 936        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
 937      }
 938      $xfer += $output->writeFieldBegin('taskAttributes', TType::MAP, 3);
 939      {
 940        $output->writeMapBegin(TType::STRING, TType::STRING, count($this->taskAttributes));
 941        {
 942          foreach ($this->taskAttributes as $kiter59 => $viter60)
 943          {
 944            $xfer += $output->writeString($kiter59);
 945            $xfer += $output->writeString($viter60);
 946          }
 947        }
 948        $output->writeMapEnd();
 949      }
 950      $xfer += $output->writeFieldEnd();
 951    }
 952    if ($this->taskCounters !== null) {
 953      if (!is_array($this->taskCounters)) {
 954        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
 955      }
 956      $xfer += $output->writeFieldBegin('taskCounters', TType::MAP, 4);
 957      {
 958        $output->writeMapBegin(TType::STRING, TType::I64, count($this->taskCounters));
 959        {
 960          foreach ($this->taskCounters as $kiter61 => $viter62)
 961          {
 962            $xfer += $output->writeString($kiter61);
 963            $xfer += $output->writeI64($viter62);
 964          }
 965        }
 966        $output->writeMapEnd();
 967      }
 968      $xfer += $output->writeFieldEnd();
 969    }
 970    if ($this->operatorGraph !== null) {
 971      if (!is_object($this->operatorGraph)) {
 972        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
 973      }
 974      $xfer += $output->writeFieldBegin('operatorGraph', TType::STRUCT, 5);
 975      $xfer += $this->operatorGraph->write($output);
 976      $xfer += $output->writeFieldEnd();
 977    }
 978    if ($this->operatorList !== null) {
 979      if (!is_array($this->operatorList)) {
 980        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
 981      }
 982      $xfer += $output->writeFieldBegin('operatorList', TType::LST, 6);
 983      {
 984        $output->writeListBegin(TType::STRUCT, count($this->operatorList));
 985        {
 986          foreach ($this->operatorList as $iter63)
 987          {
 988            $xfer += $iter63->write($output);
 989          }
 990        }
 991        $output->writeListEnd();
 992      }
 993      $xfer += $output->writeFieldEnd();
 994    }
 995    if ($this->done !== null) {
 996      $xfer += $output->writeFieldBegin('done', TType::BOOL, 7);
 997      $xfer += $output->writeBool($this->done);
 998      $xfer += $output->writeFieldEnd();
 999    }
1000    if ($this->started !== null) {
1001      $xfer += $output->writeFieldBegin('started', TType::BOOL, 8);
1002      $xfer += $output->writeBool($this->started);
1003      $xfer += $output->writeFieldEnd();
1004    }
1005    $xfer += $output->writeFieldStop();
1006    $xfer += $output->writeStructEnd();
1007    return $xfer;
1008  }
1009
1010}
1011
1012class Stage {
1013  static $_TSPEC;
1014
1015  public $stageId = null;
1016  public $stageType = null;
1017  public $stageAttributes = null;
1018  public $stageCounters = null;
1019  public $taskList = null;
1020  public $done = null;
1021  public $started = null;
1022
1023  public function __construct($vals=null) {
1024    if (!isset(self::$_TSPEC)) {
1025      self::$_TSPEC = array(
1026        1 => array(
1027          'var' => 'stageId',
1028          'type' => TType::STRING,
1029          ),
1030        2 => array(
1031          'var' => 'stageType',
1032          'type' => TType::I32,
1033          ),
1034        3 => array(
1035          'var' => 'stageAttributes',
1036          'type' => TType::MAP,
1037          'ktype' => TType::STRING,
1038          'vtype' => TType::STRING,
1039          'key' => array(
1040            'type' => TType::STRING,
1041          ),
1042          'val' => array(
1043            'type' => TType::STRING,
1044            ),
1045          ),
1046        4 => array(
1047          'var' => 'stageCounters',
1048          'type' => TType::MAP,
1049          'ktype' => TType::STRING,
1050          'vtype' => TType::I64,
1051          'key' => array(
1052            'type' => TType::STRING,
1053          ),
1054          'val' => array(
1055            'type' => TType::I64,
1056            ),
1057          ),
1058        5 => array(
1059          'var' => 'taskList',
1060          'type' => TType::LST,
1061          'etype' => TType::STRUCT,
1062          'elem' => array(
1063            'type' => TType::STRUCT,
1064            'class' => 'Task',
1065            ),
1066          ),
1067        6 => array(
1068          'var' => 'done',
1069          'type' => TType::BOOL,
1070          ),
1071        7 => array(
1072          'var' => 'started',
1073          'type' => TType::BOOL,
1074          ),
1075        );
1076    }
1077    if (is_array($vals)) {
1078      if (isset($vals['stageId'])) {
1079        $this->stageId = $vals['stageId'];
1080      }
1081      if (isset($vals['stageType'])) {
1082        $this->stageType = $vals['stageType'];
1083      }
1084      if (isset($vals['stageAttributes'])) {
1085        $this->stageAttributes = $vals['stageAttributes'];
1086      }
1087      if (isset($vals['stageCounters'])) {
1088        $this->stageCounters = $vals['stageCounters'];
1089      }
1090      if (isset($vals['taskList'])) {
1091        $this->taskList = $vals['taskList'];
1092      }
1093      if (isset($vals['done'])) {
1094        $this->done = $vals['done'];
1095      }
1096      if (isset($vals['started'])) {
1097        $this->started = $vals['started'];
1098      }
1099    }
1100  }
1101
1102  public function getName() {
1103    return 'Stage';
1104  }
1105
1106  public function read($input)
1107  {
1108    $xfer = 0;
1109    $fname = null;
1110    $ftype = 0;
1111    $fid = 0;
1112    $xfer += $input->readStructBegin($fname);
1113    while (true)
1114    {
1115      $xfer += $input->readFieldBegin($fname, $ftype, $fid);
1116      if ($ftype == TType::STOP) {
1117        break;
1118      }
1119      switch ($fid)
1120      {
1121        case 1:
1122          if ($ftype == TType::STRING) {
1123            $xfer += $input->readString($this->stageId);
1124          } else {
1125            $xfer += $input->skip($ftype);
1126          }
1127          break;
1128        case 2:
1129          if ($ftype == TType::I32) {
1130            $xfer += $input->readI32($this->stageType);
1131          } else {
1132            $xfer += $input->skip($ftype);
1133          }
1134          break;
1135        case 3:
1136          if ($ftype == TType::MAP) {
1137            $this->stageAttributes = array();
1138            $_size64 = 0;
1139            $_ktype65 = 0;
1140            $_vtype66 = 0;
1141            $xfer += $input->readMapBegin($_ktype65, $_vtype66, $_size64);
1142            for ($_i68 = 0; $_i68 < $_size64; ++$_i68)
1143            {
1144              $key69 = '';
1145              $val70 = '';
1146              $xfer += $input->readString($key69);
1147              $xfer += $input->readString($val70);
1148              $this->stageAttributes[$key69] = $val70;
1149            }
1150            $xfer += $input->readMapEnd();
1151          } else {
1152            $xfer += $input->skip($ftype);
1153          }
1154          break;
1155        case 4:
1156          if ($ftype == TType::MAP) {
1157            $this->stageCounters = array();
1158            $_size71 = 0;
1159            $_ktype72 = 0;
1160            $_vtype73 = 0;
1161            $xfer += $input->readMapBegin($_ktype72, $_vtype73, $_size71);
1162            for ($_i75 = 0; $_i75 < $_size71; ++$_i75)
1163            {
1164              $key76 = '';
1165              $val77 = 0;
1166              $xfer += $input->readString($key76);
1167              $xfer += $input->readI64($val77);
1168              $this->stageCounters[$key76] = $val77;
1169            }
1170            $xfer += $input->readMapEnd();
1171          } else {
1172            $xfer += $input->skip($ftype);
1173          }
1174          break;
1175        case 5:
1176          if ($ftype == TType::LST) {
1177            $this->taskList = array();
1178            $_size78 = 0;
1179            $_etype81 = 0;
1180            $xfer += $input->readListBegin($_etype81, $_size78);
1181            for ($_i82 = 0; $_i82 < $_size78; ++$_i82)
1182            {
1183              $elem83 = null;
1184              $elem83 = new Task();
1185              $xfer += $elem83->read($input);
1186              $this->taskList []= $elem83;
1187            }
1188            $xfer += $input->readListEnd();
1189          } else {
1190            $xfer += $input->skip($ftype);
1191          }
1192          break;
1193        case 6:
1194          if ($ftype == TType::BOOL) {
1195            $xfer += $input->readBool($this->done);
1196          } else {
1197            $xfer += $input->skip($ftype);
1198          }
1199          break;
1200        case 7:
1201          if ($ftype == TType::BOOL) {
1202            $xfer += $input->readBool($this->started);
1203          } else {
1204            $xfer += $input->skip($ftype);
1205          }
1206          break;
1207        default:
1208          $xfer += $input->skip($ftype);
1209          break;
1210      }
1211      $xfer += $input->readFieldEnd();
1212    }
1213    $xfer += $input->readStructEnd();
1214    return $xfer;
1215  }
1216
1217  public function write($output) {
1218    $xfer = 0;
1219    $xfer += $output->writeStructBegin('Stage');
1220    if ($this->stageId !== null) {
1221      $xfer += $output->writeFieldBegin('stageId', TType::STRING, 1);
1222      $xfer += $output->writeString($this->stageId);
1223      $xfer += $output->writeFieldEnd();
1224    }
1225    if ($this->stageType !== null) {
1226      $xfer += $output->writeFieldBegin('stageType', TType::I32, 2);
1227      $xfer += $output->writeI32($this->stageType);
1228      $xfer += $output->writeFieldEnd();
1229    }
1230    if ($this->stageAttributes !== null) {
1231      if (!is_array($this->stageAttributes)) {
1232        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
1233      }
1234      $xfer += $output->writeFieldBegin('stageAttributes', TType::MAP, 3);
1235      {
1236        $output->writeMapBegin(TType::STRING, TType::STRING, count($this->stageAttributes));
1237        {
1238          foreach ($this->stageAttributes as $kiter84 => $viter85)
1239          {
1240            $xfer += $output->writeString($kiter84);
1241            $xfer += $output->writeString($viter85);
1242          }
1243        }
1244        $output->writeMapEnd();
1245      }
1246      $xfer += $output->writeFieldEnd();
1247    }
1248    if ($this->stageCounters !== null) {
1249      if (!is_array($this->stageCounters)) {
1250        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
1251      }
1252      $xfer += $output->writeFieldBegin('stageCounters', TType::MAP, 4);
1253      {
1254        $output->writeMapBegin(TType::STRING, TType::I64, count($this->stageCounters));
1255        {
1256          foreach ($this->stageCounters as $kiter86 => $viter87)
1257          {
1258            $xfer += $output->writeString($kiter86);
1259            $xfer += $output->writeI64($viter87);
1260          }
1261        }
1262        $output->writeMapEnd();
1263      }
1264      $xfer += $output->writeFieldEnd();
1265    }
1266    if ($this->taskList !== null) {
1267      if (!is_array($this->taskList)) {
1268        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
1269      }
1270      $xfer += $output->writeFieldBegin('taskList', TType::LST, 5);
1271      {
1272        $output->writeListBegin(TType::STRUCT, count($this->taskList));
1273        {
1274          foreach ($this->taskList as $iter88)
1275          {
1276            $xfer += $iter88->write($output);
1277          }
1278        }
1279        $output->writeListEnd();
1280      }
1281      $xfer += $output->writeFieldEnd();
1282    }
1283    if ($this->done !== null) {
1284      $xfer += $output->writeFieldBegin('done', TType::BOOL, 6);
1285      $xfer += $output->writeBool($this->done);
1286      $xfer += $output->writeFieldEnd();
1287    }
1288    if ($this->started !== null) {
1289      $xfer += $output->writeFieldBegin('started', TType::BOOL, 7);
1290      $xfer += $output->writeBool($this->started);
1291      $xfer += $output->writeFieldEnd();
1292    }
1293    $xfer += $output->writeFieldStop();
1294    $xfer += $output->writeStructEnd();
1295    return $xfer;
1296  }
1297
1298}
1299
1300class Query {
1301  static $_TSPEC;
1302
1303  public $queryId = null;
1304  public $queryType = null;
1305  public $queryAttributes = null;
1306  public $queryCounters = null;
1307  public $stageGraph = null;
1308  public $stageList = null;
1309  public $done = null;
1310  public $started = null;
1311
1312  public function __construct($vals=null) {
1313    if (!isset(self::$_TSPEC)) {
1314      self::$_TSPEC = array(
1315        1 => array(
1316          'var' => 'queryId',
1317          'type' => TType::STRING,
1318          ),
1319        2 => array(
1320          'var' => 'queryType',
1321          'type' => TType::STRING,
1322          ),
1323        3 => array(
1324          'var' => 'queryAttributes',
1325          'type' => TType::MAP,
1326          'ktype' => TType::STRING,
1327          'vtype' => TType::STRING,
1328          'key' => array(
1329            'type' => TType::STRING,
1330          ),
1331          'val' => array(
1332            'type' => TType::STRING,
1333            ),
1334          ),
1335        4 => array(
1336          'var' => 'queryCounters',
1337          'type' => TType::MAP,
1338          'ktype' => TType::STRING,
1339          'vtype' => TType::I64,
1340          'key' => array(
1341            'type' => TType::STRING,
1342          ),
1343          'val' => array(
1344            'type' => TType::I64,
1345            ),
1346          ),
1347        5 => array(
1348          'var' => 'stageGraph',
1349          'type' => TType::STRUCT,
1350          'class' => 'Graph',
1351          ),
1352        6 => array(
1353          'var' => 'stageList',
1354          'type' => TType::LST,
1355          'etype' => TType::STRUCT,
1356          'elem' => array(
1357            'type' => TType::STRUCT,
1358            'class' => 'Stage',
1359            ),
1360          ),
1361        7 => array(
1362          'var' => 'done',
1363          'type' => TType::BOOL,
1364          ),
1365        8 => array(
1366          'var' => 'started',
1367          'type' => TType::BOOL,
1368          ),
1369        );
1370    }
1371    if (is_array($vals)) {
1372      if (isset($vals['queryId'])) {
1373        $this->queryId = $vals['queryId'];
1374      }
1375      if (isset($vals['queryType'])) {
1376        $this->queryType = $vals['queryType'];
1377      }
1378      if (isset($vals['queryAttributes'])) {
1379        $this->queryAttributes = $vals['queryAttributes'];
1380      }
1381      if (isset($vals['queryCounters'])) {
1382        $this->queryCounters = $vals['queryCounters'];
1383      }
1384      if (isset($vals['stageGraph'])) {
1385        $this->stageGraph = $vals['stageGraph'];
1386      }
1387      if (isset($vals['stageList'])) {
1388        $this->stageList = $vals['stageList'];
1389      }
1390      if (isset($vals['done'])) {
1391        $this->done = $vals['done'];
1392      }
1393      if (isset($vals['started'])) {
1394        $this->started = $vals['started'];
1395      }
1396    }
1397  }
1398
1399  public function getName() {
1400    return 'Query';
1401  }
1402
1403  public function read($input)
1404  {
1405    $xfer = 0;
1406    $fname = null;
1407    $ftype = 0;
1408    $fid = 0;
1409    $xfer += $input->readStructBegin($fname);
1410    while (true)
1411    {
1412      $xfer += $input->readFieldBegin($fname, $ftype, $fid);
1413      if ($ftype == TType::STOP) {
1414        break;
1415      }
1416      switch ($fid)
1417      {
1418        case 1:
1419          if ($ftype == TType::STRING) {
1420            $xfer += $input->readString($this->queryId);
1421          } else {
1422            $xfer += $input->skip($ftype);
1423          }
1424          break;
1425        case 2:
1426          if ($ftype == TType::STRING) {
1427            $xfer += $input->readString($this->queryType);
1428          } else {
1429            $xfer += $input->skip($ftype);
1430          }
1431          break;
1432        case 3:
1433          if ($ftype == TType::MAP) {
1434            $this->queryAttributes = array();
1435            $_size89 = 0;
1436            $_ktype90 = 0;
1437            $_vtype91 = 0;
1438            $xfer += $input->readMapBegin($_ktype90, $_vtype91, $_size89);
1439            for ($_i93 = 0; $_i93 < $_size89; ++$_i93)
1440            {
1441              $key94 = '';
1442              $val95 = '';
1443              $xfer += $input->readString($key94);
1444              $xfer += $input->readString($val95);
1445              $this->queryAttributes[$key94] = $val95;
1446            }
1447            $xfer += $input->readMapEnd();
1448          } else {
1449            $xfer += $input->skip($ftype);
1450          }
1451          break;
1452        case 4:
1453          if ($ftype == TType::MAP) {
1454            $this->queryCounters = array();
1455            $_size96 = 0;
1456            $_ktype97 = 0;
1457            $_vtype98 = 0;
1458            $xfer += $input->readMapBegin($_ktype97, $_vtype98, $_size96);
1459            for ($_i100 = 0; $_i100 < $_size96; ++$_i100)
1460            {
1461              $key101 = '';
1462              $val102 = 0;
1463              $xfer += $input->readString($key101);
1464              $xfer += $input->readI64($val102);
1465              $this->queryCounters[$key101] = $val102;
1466            }
1467            $xfer += $input->readMapEnd();
1468          } else {
1469            $xfer += $input->skip($ftype);
1470          }
1471          break;
1472        case 5:
1473          if ($ftype == TType::STRUCT) {
1474            $this->stageGraph = new Graph();
1475            $xfer += $this->stageGraph->read($input);
1476          } else {
1477            $xfer += $input->skip($ftype);
1478          }
1479          break;
1480        case 6:
1481          if ($ftype == TType::LST) {
1482            $this->stageList = array();
1483            $_size103 = 0;
1484            $_etype106 = 0;
1485            $xfer += $input->readListBegin($_etype106, $_size103);
1486            for ($_i107 = 0; $_i107 < $_size103; ++$_i107)
1487            {
1488              $elem108 = null;
1489              $elem108 = new Stage();
1490              $xfer += $elem108->read($input);
1491              $this->stageList []= $elem108;
1492            }
1493            $xfer += $input->readListEnd();
1494          } else {
1495            $xfer += $input->skip($ftype);
1496          }
1497          break;
1498        case 7:
1499          if ($ftype == TType::BOOL) {
1500            $xfer += $input->readBool($this->done);
1501          } else {
1502            $xfer += $input->skip($ftype);
1503          }
1504          break;
1505        case 8:
1506          if ($ftype == TType::BOOL) {
1507            $xfer += $input->readBool($this->started);
1508          } else {
1509            $xfer += $input->skip($ftype);
1510          }
1511          break;
1512        default:
1513          $xfer += $input->skip($ftype);
1514          break;
1515      }
1516      $xfer += $input->readFieldEnd();
1517    }
1518    $xfer += $input->readStructEnd();
1519    return $xfer;
1520  }
1521
1522  public function write($output) {
1523    $xfer = 0;
1524    $xfer += $output->writeStructBegin('Query');
1525    if ($this->queryId !== null) {
1526      $xfer += $output->writeFieldBegin('queryId', TType::STRING, 1);
1527      $xfer += $output->writeString($this->queryId);
1528      $xfer += $output->writeFieldEnd();
1529    }
1530    if ($this->queryType !== null) {
1531      $xfer += $output->writeFieldBegin('queryType', TType::STRING, 2);
1532      $xfer += $output->writeString($this->queryType);
1533      $xfer += $output->writeFieldEnd();
1534    }
1535    if ($this->queryAttributes !== null) {
1536      if (!is_array($this->queryAttributes)) {
1537        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
1538      }
1539      $xfer += $output->writeFieldBegin('queryAttributes', TType::MAP, 3);
1540      {
1541        $output->writeMapBegin(TType::STRING, TType::STRING, count($this->queryAttributes));
1542        {
1543          foreach ($this->queryAttributes as $kiter109 => $viter110)
1544          {
1545            $xfer += $output->writeString($kiter109);
1546            $xfer += $output->writeString($viter110);
1547          }
1548        }
1549        $output->writeMapEnd();
1550      }
1551      $xfer += $output->writeFieldEnd();
1552    }
1553    if ($this->queryCounters !== null) {
1554      if (!is_array($this->queryCounters)) {
1555        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
1556      }
1557      $xfer += $output->writeFieldBegin('queryCounters', TType::MAP, 4);
1558      {
1559        $output->writeMapBegin(TType::STRING, TType::I64, count($this->queryCounters));
1560        {
1561          foreach ($this->queryCounters as $kiter111 => $viter112)
1562          {
1563            $xfer += $output->writeString($kiter111);
1564            $xfer += $output->writeI64($viter112);
1565          }
1566        }
1567        $output->writeMapEnd();
1568      }
1569      $xfer += $output->writeFieldEnd();
1570    }
1571    if ($this->stageGraph !== null) {
1572      if (!is_object($this->stageGraph)) {
1573        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
1574      }
1575      $xfer += $output->writeFieldBegin('stageGraph', TType::STRUCT, 5);
1576      $xfer += $this->stageGraph->write($output);
1577      $xfer += $output->writeFieldEnd();
1578    }
1579    if ($this->stageList !== null) {
1580      if (!is_array($this->stageList)) {
1581        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
1582      }
1583      $xfer += $output->writeFieldBegin('stageList', TType::LST, 6);
1584      {
1585        $output->writeListBegin(TType::STRUCT, count($this->stageList));
1586        {
1587          foreach ($this->stageList as $iter113)
1588          {
1589            $xfer += $iter113->write($output);
1590          }
1591        }
1592        $output->writeListEnd();
1593      }
1594      $xfer += $output->writeFieldEnd();
1595    }
1596    if ($this->done !== null) {
1597      $xfer += $output->writeFieldBegin('done', TType::BOOL, 7);
1598      $xfer += $output->writeBool($this->done);
1599      $xfer += $output->writeFieldEnd();
1600    }
1601    if ($this->started !== null) {
1602      $xfer += $output->writeFieldBegin('started', TType::BOOL, 8);
1603      $xfer += $output->writeBool($this->started);
1604      $xfer += $output->writeFieldEnd();
1605    }
1606    $xfer += $output->writeFieldStop();
1607    $xfer += $output->writeStructEnd();
1608    return $xfer;
1609  }
1610
1611}
1612
1613class QueryPlan {
1614  static $_TSPEC;
1615
1616  public $queries = null;
1617  public $done = null;
1618  public $started = null;
1619
1620  public function __construct($vals=null) {
1621    if (!isset(self::$_TSPEC)) {
1622      self::$_TSPEC = array(
1623        1 => array(
1624          'var' => 'queries',
1625          'type' => TType::LST,
1626          'etype' => TType::STRUCT,
1627          'elem' => array(
1628            'type' => TType::STRUCT,
1629            'class' => 'Query',
1630            ),
1631          ),
1632        2 => array(
1633          'var' => 'done',
1634          'type' => TType::BOOL,
1635          ),
1636        3 => array(
1637          'var' => 'started',
1638          'type' => TType::BOOL,
1639          ),
1640        );
1641    }
1642    if (is_array($vals)) {
1643      if (isset($vals['queries'])) {
1644        $this->queries = $vals['queries'];
1645      }
1646      if (isset($vals['done'])) {
1647        $this->done = $vals['done'];
1648      }
1649      if (isset($vals['started'])) {
1650        $this->started = $vals['started'];
1651      }
1652    }
1653  }
1654
1655  public function getName() {
1656    return 'QueryPlan';
1657  }
1658
1659  public function read($input)
1660  {
1661    $xfer = 0;
1662    $fname = null;
1663    $ftype = 0;
1664    $fid = 0;
1665    $xfer += $input->readStructBegin($fname);
1666    while (true)
1667    {
1668      $xfer += $input->readFieldBegin($fname, $ftype, $fid);
1669      if ($ftype == TType::STOP) {
1670        break;
1671      }
1672      switch ($fid)
1673      {
1674        case 1:
1675          if ($ftype == TType::LST) {
1676            $this->queries = array();
1677            $_size114 = 0;
1678            $_etype117 = 0;
1679            $xfer += $input->readListBegin($_etype117, $_size114);
1680            for ($_i118 = 0; $_i118 < $_size114; ++$_i118)
1681            {
1682              $elem119 = null;
1683              $elem119 = new Query();
1684              $xfer += $elem119->read($input);
1685              $this->queries []= $elem119;
1686            }
1687            $xfer += $input->readListEnd();
1688          } else {
1689            $xfer += $input->skip($ftype);
1690          }
1691          break;
1692        case 2:
1693          if ($ftype == TType::BOOL) {
1694            $xfer += $input->readBool($this->done);
1695          } else {
1696            $xfer += $input->skip($ftype);
1697          }
1698          break;
1699        case 3:
1700          if ($ftype == TType::BOOL) {
1701            $xfer += $input->readBool($this->started);
1702          } else {
1703            $xfer += $input->skip($ftype);
1704          }
1705          break;
1706        default:
1707          $xfer += $input->skip($ftype);
1708          break;
1709      }
1710      $xfer += $input->readFieldEnd();
1711    }
1712    $xfer += $input->readStructEnd();
1713    return $xfer;
1714  }
1715
1716  public function write($output) {
1717    $xfer = 0;
1718    $xfer += $output->writeStructBegin('QueryPlan');
1719    if ($this->queries !== null) {
1720      if (!is_array($this->queries)) {
1721        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
1722      }
1723      $xfer += $output->writeFieldBegin('queries', TType::LST, 1);
1724      {
1725        $output->writeListBegin(TType::STRUCT, count($this->queries));
1726        {
1727          foreach ($this->queries as $iter120)
1728          {
1729            $xfer += $iter120->write($output);
1730          }
1731        }
1732        $output->writeListEnd();
1733      }
1734      $xfer += $output->writeFieldEnd();
1735    }
1736    if ($this->done !== null) {
1737      $xfer += $output->writeFieldBegin('done', TType::BOOL, 2);
1738      $xfer += $output->writeBool($this->done);
1739      $xfer += $output->writeFieldEnd();
1740    }
1741    if ($this->started !== null) {
1742      $xfer += $output->writeFieldBegin('started', TType::BOOL, 3);
1743      $xfer += $output->writeBool($this->started);
1744      $xfer += $output->writeFieldEnd();
1745    }
1746    $xfer += $output->writeFieldStop();
1747    $xfer += $output->writeStructEnd();
1748    return $xfer;
1749  }
1750
1751}
1752
1753?>