Subversion Repositories qbpwcf-lib(archive)

Rev

Rev 915 | Blame | Compare with Previous | Last modification | View Log | RSS feed

<?php
/**
 * Autogenerated by Thrift Compiler (0.9.3)
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated
 */
use Thrift\Base\TBase;
use Thrift\Type\TType;
use Thrift\Type\TMessageType;
use Thrift\Exception\TException;
use Thrift\Exception\TProtocolException;
use Thrift\Protocol\TProtocol;
use Thrift\Protocol\TBinaryProtocolAccelerated;
use Thrift\Exception\TApplicationException;


final class AdjacencyType {
  const CONJUNCTIVE = 0;
  const DISJUNCTIVE = 1;
  static public $__names = array(
    0 => 'CONJUNCTIVE',
    1 => 'DISJUNCTIVE',
  );
}

final class NodeType {
  const OPERATOR = 0;
  const STAGE = 1;
  static public $__names = array(
    0 => 'OPERATOR',
    1 => 'STAGE',
  );
}

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;
  const UDTF = 13;
  const LATERALVIEWJOIN = 14;
  const LATERALVIEWFORWARD = 15;
  const HASHTABLESINK = 16;
  const HASHTABLEDUMMY = 17;
  const PTF = 18;
  const MUX = 19;
  const DEMUX = 20;
  const EVENT = 21;
  const ORCFILEMERGE = 22;
  const RCFILEMERGE = 23;
  const MERGEJOIN = 24;
  const SPARKPRUNINGSINK = 25;
  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',
    13 => 'UDTF',
    14 => 'LATERALVIEWJOIN',
    15 => 'LATERALVIEWFORWARD',
    16 => 'HASHTABLESINK',
    17 => 'HASHTABLEDUMMY',
    18 => 'PTF',
    19 => 'MUX',
    20 => 'DEMUX',
    21 => 'EVENT',
    22 => 'ORCFILEMERGE',
    23 => 'RCFILEMERGE',
    24 => 'MERGEJOIN',
    25 => 'SPARKPRUNINGSINK',
  );
}

final class TaskType {
  const MAP = 0;
  const REDUCE = 1;
  const OTHER = 2;
  static public $__names = array(
    0 => 'MAP',
    1 => 'REDUCE',
    2 => 'OTHER',
  );
}

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;
  const STATS = 9;
  const DEPENDENCY_COLLECTION = 10;
  const COLUMNSTATS = 11;
  static public $__names = array(
    0 => 'CONDITIONAL',
    1 => 'COPY',
    2 => 'DDL',
    3 => 'MAPRED',
    4 => 'EXPLAIN',
    5 => 'FETCH',
    6 => 'FUNC',
    7 => 'MAPREDLOCAL',
    8 => 'MOVE',
    9 => 'STATS',
    10 => 'DEPENDENCY_COLLECTION',
    11 => 'COLUMNSTATS',
  );
}

class Adjacency {
  static $_TSPEC;

  /**
   * @var string
   */
  public $node = null;
  /**
   * @var string[]
   */
  public $children = null;
  /**
   * @var int
   */
  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;

  /**
   * @var int
   */
  public $nodeType = null;
  /**
   * @var string[]
   */
  public $roots = null;
  /**
   * @var \Adjacency[]
   */
  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;

  /**
   * @var string
   */
  public $operatorId = null;
  /**
   * @var int
   */
  public $operatorType = null;
  /**
   * @var array
   */
  public $operatorAttributes = null;
  /**
   * @var array
   */
  public $operatorCounters = null;
  /**
   * @var bool
   */
  public $done = null;
  /**
   * @var bool
   */
  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;

  /**
   * @var string
   */
  public $taskId = null;
  /**
   * @var int
   */
  public $taskType = null;
  /**
   * @var array
   */
  public $taskAttributes = null;
  /**
   * @var array
   */
  public $taskCounters = null;
  /**
   * @var \Graph
   */
  public $operatorGraph = null;
  /**
   * @var \Operator[]
   */
  public $operatorList = null;
  /**
   * @var bool
   */
  public $done = null;
  /**
   * @var bool
   */
  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;

  /**
   * @var string
   */
  public $stageId = null;
  /**
   * @var int
   */
  public $stageType = null;
  /**
   * @var array
   */
  public $stageAttributes = null;
  /**
   * @var array
   */
  public $stageCounters = null;
  /**
   * @var \Task[]
   */
  public $taskList = null;
  /**
   * @var bool
   */
  public $done = null;
  /**
   * @var bool
   */
  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;

  /**
   * @var string
   */
  public $queryId = null;
  /**
   * @var string
   */
  public $queryType = null;
  /**
   * @var array
   */
  public $queryAttributes = null;
  /**
   * @var array
   */
  public $queryCounters = null;
  /**
   * @var \Graph
   */
  public $stageGraph = null;
  /**
   * @var \Stage[]
   */
  public $stageList = null;
  /**
   * @var bool
   */
  public $done = null;
  /**
   * @var bool
   */
  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;

  /**
   * @var \Query[]
   */
  public $queries = null;
  /**
   * @var bool
   */
  public $done = null;
  /**
   * @var bool
   */
  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;
  }

}