<?php
namespace metastore;

/**
 * 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 HiveObjectType {
  const GLOBAL = 1;
  const DATABASE = 2;
  const TABLE = 3;
  const PARTITION = 4;
  const COLUMN = 5;
  static public $__names = array(
    1 => 'GLOBAL',
    2 => 'DATABASE',
    3 => 'TABLE',
    4 => 'PARTITION',
    5 => 'COLUMN',
  );
}

final class PrincipalType {
  const USER = 1;
  const ROLE = 2;
  const GROUP = 3;
  static public $__names = array(
    1 => 'USER',
    2 => 'ROLE',
    3 => 'GROUP',
  );
}

final class PartitionEventType {
  const LOAD_DONE = 1;
  static public $__names = array(
    1 => 'LOAD_DONE',
  );
}

final class TxnState {
  const COMMITTED = 1;
  const ABORTED = 2;
  const OPEN = 3;
  static public $__names = array(
    1 => 'COMMITTED',
    2 => 'ABORTED',
    3 => 'OPEN',
  );
}

final class LockLevel {
  const DB = 1;
  const TABLE = 2;
  const PARTITION = 3;
  static public $__names = array(
    1 => 'DB',
    2 => 'TABLE',
    3 => 'PARTITION',
  );
}

final class LockState {
  const ACQUIRED = 1;
  const WAITING = 2;
  const ABORT = 3;
  const NOT_ACQUIRED = 4;
  static public $__names = array(
    1 => 'ACQUIRED',
    2 => 'WAITING',
    3 => 'ABORT',
    4 => 'NOT_ACQUIRED',
  );
}

final class LockType {
  const SHARED_READ = 1;
  const SHARED_WRITE = 2;
  const EXCLUSIVE = 3;
  static public $__names = array(
    1 => 'SHARED_READ',
    2 => 'SHARED_WRITE',
    3 => 'EXCLUSIVE',
  );
}

final class CompactionType {
  const MINOR = 1;
  const MAJOR = 2;
  static public $__names = array(
    1 => 'MINOR',
    2 => 'MAJOR',
  );
}

final class GrantRevokeType {
  const GRANT = 1;
  const REVOKE = 2;
  static public $__names = array(
    1 => 'GRANT',
    2 => 'REVOKE',
  );
}

final class DataOperationType {
  const SELECT = 1;
  const INSERT = 2;
  const UPDATE = 3;
  const DELETE = 4;
  const UNSET = 5;
  const NO_TXN = 6;
  static public $__names = array(
    1 => 'SELECT',
    2 => 'INSERT',
    3 => 'UPDATE',
    4 => 'DELETE',
    5 => 'UNSET',
    6 => 'NO_TXN',
  );
}

final class EventRequestType {
  const INSERT = 1;
  const UPDATE = 2;
  const DELETE = 3;
  static public $__names = array(
    1 => 'INSERT',
    2 => 'UPDATE',
    3 => 'DELETE',
  );
}

final class FunctionType {
  const JAVA = 1;
  static public $__names = array(
    1 => 'JAVA',
  );
}

final class ResourceType {
  const JAR = 1;
  const FILE = 2;
  const ARCHIVE = 3;
  static public $__names = array(
    1 => 'JAR',
    2 => 'FILE',
    3 => 'ARCHIVE',
  );
}

final class FileMetadataExprType {
  const ORC_SARG = 1;
  static public $__names = array(
    1 => 'ORC_SARG',
  );
}

final class ClientCapability {
  const TEST_CAPABILITY = 1;
  static public $__names = array(
    1 => 'TEST_CAPABILITY',
  );
}

class Version {
  static $_TSPEC;

  /**
   * @var string
   */
  public $version = null;
  /**
   * @var string
   */
  public $comments = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'version',
          'type' => TType::STRING,
          ),
        2 => array(
          'var' => 'comments',
          'type' => TType::STRING,
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['version'])) {
        $this->version = $vals['version'];
      }
      if (isset($vals['comments'])) {
        $this->comments = $vals['comments'];
      }
    }
  }

  public function getName() {
    return 'Version';
  }

  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->version);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 2:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->comments);
          } 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('Version');
    if ($this->version !== null) {
      $xfer += $output->writeFieldBegin('version', TType::STRING, 1);
      $xfer += $output->writeString($this->version);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->comments !== null) {
      $xfer += $output->writeFieldBegin('comments', TType::STRING, 2);
      $xfer += $output->writeString($this->comments);
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class FieldSchema {
  static $_TSPEC;

  /**
   * @var string
   */
  public $name = null;
  /**
   * @var string
   */
  public $type = null;
  /**
   * @var string
   */
  public $comment = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'name',
          'type' => TType::STRING,
          ),
        2 => array(
          'var' => 'type',
          'type' => TType::STRING,
          ),
        3 => array(
          'var' => 'comment',
          'type' => TType::STRING,
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['name'])) {
        $this->name = $vals['name'];
      }
      if (isset($vals['type'])) {
        $this->type = $vals['type'];
      }
      if (isset($vals['comment'])) {
        $this->comment = $vals['comment'];
      }
    }
  }

  public function getName() {
    return 'FieldSchema';
  }

  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->name);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 2:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->type);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 3:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->comment);
          } 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('FieldSchema');
    if ($this->name !== null) {
      $xfer += $output->writeFieldBegin('name', TType::STRING, 1);
      $xfer += $output->writeString($this->name);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->type !== null) {
      $xfer += $output->writeFieldBegin('type', TType::STRING, 2);
      $xfer += $output->writeString($this->type);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->comment !== null) {
      $xfer += $output->writeFieldBegin('comment', TType::STRING, 3);
      $xfer += $output->writeString($this->comment);
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class SQLPrimaryKey {
  static $_TSPEC;

  /**
   * @var string
   */
  public $table_db = null;
  /**
   * @var string
   */
  public $table_name = null;
  /**
   * @var string
   */
  public $column_name = null;
  /**
   * @var int
   */
  public $key_seq = null;
  /**
   * @var string
   */
  public $pk_name = null;
  /**
   * @var bool
   */
  public $enable_cstr = null;
  /**
   * @var bool
   */
  public $validate_cstr = null;
  /**
   * @var bool
   */
  public $rely_cstr = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'table_db',
          'type' => TType::STRING,
          ),
        2 => array(
          'var' => 'table_name',
          'type' => TType::STRING,
          ),
        3 => array(
          'var' => 'column_name',
          'type' => TType::STRING,
          ),
        4 => array(
          'var' => 'key_seq',
          'type' => TType::I32,
          ),
        5 => array(
          'var' => 'pk_name',
          'type' => TType::STRING,
          ),
        6 => array(
          'var' => 'enable_cstr',
          'type' => TType::BOOL,
          ),
        7 => array(
          'var' => 'validate_cstr',
          'type' => TType::BOOL,
          ),
        8 => array(
          'var' => 'rely_cstr',
          'type' => TType::BOOL,
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['table_db'])) {
        $this->table_db = $vals['table_db'];
      }
      if (isset($vals['table_name'])) {
        $this->table_name = $vals['table_name'];
      }
      if (isset($vals['column_name'])) {
        $this->column_name = $vals['column_name'];
      }
      if (isset($vals['key_seq'])) {
        $this->key_seq = $vals['key_seq'];
      }
      if (isset($vals['pk_name'])) {
        $this->pk_name = $vals['pk_name'];
      }
      if (isset($vals['enable_cstr'])) {
        $this->enable_cstr = $vals['enable_cstr'];
      }
      if (isset($vals['validate_cstr'])) {
        $this->validate_cstr = $vals['validate_cstr'];
      }
      if (isset($vals['rely_cstr'])) {
        $this->rely_cstr = $vals['rely_cstr'];
      }
    }
  }

  public function getName() {
    return 'SQLPrimaryKey';
  }

  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->table_db);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 2:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->table_name);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 3:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->column_name);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 4:
          if ($ftype == TType::I32) {
            $xfer += $input->readI32($this->key_seq);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 5:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->pk_name);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 6:
          if ($ftype == TType::BOOL) {
            $xfer += $input->readBool($this->enable_cstr);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 7:
          if ($ftype == TType::BOOL) {
            $xfer += $input->readBool($this->validate_cstr);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 8:
          if ($ftype == TType::BOOL) {
            $xfer += $input->readBool($this->rely_cstr);
          } 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('SQLPrimaryKey');
    if ($this->table_db !== null) {
      $xfer += $output->writeFieldBegin('table_db', TType::STRING, 1);
      $xfer += $output->writeString($this->table_db);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->table_name !== null) {
      $xfer += $output->writeFieldBegin('table_name', TType::STRING, 2);
      $xfer += $output->writeString($this->table_name);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->column_name !== null) {
      $xfer += $output->writeFieldBegin('column_name', TType::STRING, 3);
      $xfer += $output->writeString($this->column_name);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->key_seq !== null) {
      $xfer += $output->writeFieldBegin('key_seq', TType::I32, 4);
      $xfer += $output->writeI32($this->key_seq);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->pk_name !== null) {
      $xfer += $output->writeFieldBegin('pk_name', TType::STRING, 5);
      $xfer += $output->writeString($this->pk_name);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->enable_cstr !== null) {
      $xfer += $output->writeFieldBegin('enable_cstr', TType::BOOL, 6);
      $xfer += $output->writeBool($this->enable_cstr);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->validate_cstr !== null) {
      $xfer += $output->writeFieldBegin('validate_cstr', TType::BOOL, 7);
      $xfer += $output->writeBool($this->validate_cstr);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->rely_cstr !== null) {
      $xfer += $output->writeFieldBegin('rely_cstr', TType::BOOL, 8);
      $xfer += $output->writeBool($this->rely_cstr);
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class SQLForeignKey {
  static $_TSPEC;

  /**
   * @var string
   */
  public $pktable_db = null;
  /**
   * @var string
   */
  public $pktable_name = null;
  /**
   * @var string
   */
  public $pkcolumn_name = null;
  /**
   * @var string
   */
  public $fktable_db = null;
  /**
   * @var string
   */
  public $fktable_name = null;
  /**
   * @var string
   */
  public $fkcolumn_name = null;
  /**
   * @var int
   */
  public $key_seq = null;
  /**
   * @var int
   */
  public $update_rule = null;
  /**
   * @var int
   */
  public $delete_rule = null;
  /**
   * @var string
   */
  public $fk_name = null;
  /**
   * @var string
   */
  public $pk_name = null;
  /**
   * @var bool
   */
  public $enable_cstr = null;
  /**
   * @var bool
   */
  public $validate_cstr = null;
  /**
   * @var bool
   */
  public $rely_cstr = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'pktable_db',
          'type' => TType::STRING,
          ),
        2 => array(
          'var' => 'pktable_name',
          'type' => TType::STRING,
          ),
        3 => array(
          'var' => 'pkcolumn_name',
          'type' => TType::STRING,
          ),
        4 => array(
          'var' => 'fktable_db',
          'type' => TType::STRING,
          ),
        5 => array(
          'var' => 'fktable_name',
          'type' => TType::STRING,
          ),
        6 => array(
          'var' => 'fkcolumn_name',
          'type' => TType::STRING,
          ),
        7 => array(
          'var' => 'key_seq',
          'type' => TType::I32,
          ),
        8 => array(
          'var' => 'update_rule',
          'type' => TType::I32,
          ),
        9 => array(
          'var' => 'delete_rule',
          'type' => TType::I32,
          ),
        10 => array(
          'var' => 'fk_name',
          'type' => TType::STRING,
          ),
        11 => array(
          'var' => 'pk_name',
          'type' => TType::STRING,
          ),
        12 => array(
          'var' => 'enable_cstr',
          'type' => TType::BOOL,
          ),
        13 => array(
          'var' => 'validate_cstr',
          'type' => TType::BOOL,
          ),
        14 => array(
          'var' => 'rely_cstr',
          'type' => TType::BOOL,
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['pktable_db'])) {
        $this->pktable_db = $vals['pktable_db'];
      }
      if (isset($vals['pktable_name'])) {
        $this->pktable_name = $vals['pktable_name'];
      }
      if (isset($vals['pkcolumn_name'])) {
        $this->pkcolumn_name = $vals['pkcolumn_name'];
      }
      if (isset($vals['fktable_db'])) {
        $this->fktable_db = $vals['fktable_db'];
      }
      if (isset($vals['fktable_name'])) {
        $this->fktable_name = $vals['fktable_name'];
      }
      if (isset($vals['fkcolumn_name'])) {
        $this->fkcolumn_name = $vals['fkcolumn_name'];
      }
      if (isset($vals['key_seq'])) {
        $this->key_seq = $vals['key_seq'];
      }
      if (isset($vals['update_rule'])) {
        $this->update_rule = $vals['update_rule'];
      }
      if (isset($vals['delete_rule'])) {
        $this->delete_rule = $vals['delete_rule'];
      }
      if (isset($vals['fk_name'])) {
        $this->fk_name = $vals['fk_name'];
      }
      if (isset($vals['pk_name'])) {
        $this->pk_name = $vals['pk_name'];
      }
      if (isset($vals['enable_cstr'])) {
        $this->enable_cstr = $vals['enable_cstr'];
      }
      if (isset($vals['validate_cstr'])) {
        $this->validate_cstr = $vals['validate_cstr'];
      }
      if (isset($vals['rely_cstr'])) {
        $this->rely_cstr = $vals['rely_cstr'];
      }
    }
  }

  public function getName() {
    return 'SQLForeignKey';
  }

  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->pktable_db);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 2:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->pktable_name);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 3:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->pkcolumn_name);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 4:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->fktable_db);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 5:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->fktable_name);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 6:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->fkcolumn_name);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 7:
          if ($ftype == TType::I32) {
            $xfer += $input->readI32($this->key_seq);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 8:
          if ($ftype == TType::I32) {
            $xfer += $input->readI32($this->update_rule);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 9:
          if ($ftype == TType::I32) {
            $xfer += $input->readI32($this->delete_rule);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 10:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->fk_name);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 11:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->pk_name);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 12:
          if ($ftype == TType::BOOL) {
            $xfer += $input->readBool($this->enable_cstr);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 13:
          if ($ftype == TType::BOOL) {
            $xfer += $input->readBool($this->validate_cstr);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 14:
          if ($ftype == TType::BOOL) {
            $xfer += $input->readBool($this->rely_cstr);
          } 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('SQLForeignKey');
    if ($this->pktable_db !== null) {
      $xfer += $output->writeFieldBegin('pktable_db', TType::STRING, 1);
      $xfer += $output->writeString($this->pktable_db);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->pktable_name !== null) {
      $xfer += $output->writeFieldBegin('pktable_name', TType::STRING, 2);
      $xfer += $output->writeString($this->pktable_name);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->pkcolumn_name !== null) {
      $xfer += $output->writeFieldBegin('pkcolumn_name', TType::STRING, 3);
      $xfer += $output->writeString($this->pkcolumn_name);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->fktable_db !== null) {
      $xfer += $output->writeFieldBegin('fktable_db', TType::STRING, 4);
      $xfer += $output->writeString($this->fktable_db);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->fktable_name !== null) {
      $xfer += $output->writeFieldBegin('fktable_name', TType::STRING, 5);
      $xfer += $output->writeString($this->fktable_name);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->fkcolumn_name !== null) {
      $xfer += $output->writeFieldBegin('fkcolumn_name', TType::STRING, 6);
      $xfer += $output->writeString($this->fkcolumn_name);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->key_seq !== null) {
      $xfer += $output->writeFieldBegin('key_seq', TType::I32, 7);
      $xfer += $output->writeI32($this->key_seq);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->update_rule !== null) {
      $xfer += $output->writeFieldBegin('update_rule', TType::I32, 8);
      $xfer += $output->writeI32($this->update_rule);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->delete_rule !== null) {
      $xfer += $output->writeFieldBegin('delete_rule', TType::I32, 9);
      $xfer += $output->writeI32($this->delete_rule);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->fk_name !== null) {
      $xfer += $output->writeFieldBegin('fk_name', TType::STRING, 10);
      $xfer += $output->writeString($this->fk_name);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->pk_name !== null) {
      $xfer += $output->writeFieldBegin('pk_name', TType::STRING, 11);
      $xfer += $output->writeString($this->pk_name);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->enable_cstr !== null) {
      $xfer += $output->writeFieldBegin('enable_cstr', TType::BOOL, 12);
      $xfer += $output->writeBool($this->enable_cstr);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->validate_cstr !== null) {
      $xfer += $output->writeFieldBegin('validate_cstr', TType::BOOL, 13);
      $xfer += $output->writeBool($this->validate_cstr);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->rely_cstr !== null) {
      $xfer += $output->writeFieldBegin('rely_cstr', TType::BOOL, 14);
      $xfer += $output->writeBool($this->rely_cstr);
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class Type {
  static $_TSPEC;

  /**
   * @var string
   */
  public $name = null;
  /**
   * @var string
   */
  public $type1 = null;
  /**
   * @var string
   */
  public $type2 = null;
  /**
   * @var \metastore\FieldSchema[]
   */
  public $fields = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'name',
          'type' => TType::STRING,
          ),
        2 => array(
          'var' => 'type1',
          'type' => TType::STRING,
          ),
        3 => array(
          'var' => 'type2',
          'type' => TType::STRING,
          ),
        4 => array(
          'var' => 'fields',
          'type' => TType::LST,
          'etype' => TType::STRUCT,
          'elem' => array(
            'type' => TType::STRUCT,
            'class' => '\metastore\FieldSchema',
            ),
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['name'])) {
        $this->name = $vals['name'];
      }
      if (isset($vals['type1'])) {
        $this->type1 = $vals['type1'];
      }
      if (isset($vals['type2'])) {
        $this->type2 = $vals['type2'];
      }
      if (isset($vals['fields'])) {
        $this->fields = $vals['fields'];
      }
    }
  }

  public function getName() {
    return 'Type';
  }

  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->name);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 2:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->type1);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 3:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->type2);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 4:
          if ($ftype == TType::LST) {
            $this->fields = array();
            $_size0 = 0;
            $_etype3 = 0;
            $xfer += $input->readListBegin($_etype3, $_size0);
            for ($_i4 = 0; $_i4 < $_size0; ++$_i4)
            {
              $elem5 = null;
              $elem5 = new \metastore\FieldSchema();
              $xfer += $elem5->read($input);
              $this->fields []= $elem5;
            }
            $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('Type');
    if ($this->name !== null) {
      $xfer += $output->writeFieldBegin('name', TType::STRING, 1);
      $xfer += $output->writeString($this->name);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->type1 !== null) {
      $xfer += $output->writeFieldBegin('type1', TType::STRING, 2);
      $xfer += $output->writeString($this->type1);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->type2 !== null) {
      $xfer += $output->writeFieldBegin('type2', TType::STRING, 3);
      $xfer += $output->writeString($this->type2);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->fields !== null) {
      if (!is_array($this->fields)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('fields', TType::LST, 4);
      {
        $output->writeListBegin(TType::STRUCT, count($this->fields));
        {
          foreach ($this->fields as $iter6)
          {
            $xfer += $iter6->write($output);
          }
        }
        $output->writeListEnd();
      }
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class HiveObjectRef {
  static $_TSPEC;

  /**
   * @var int
   */
  public $objectType = null;
  /**
   * @var string
   */
  public $dbName = null;
  /**
   * @var string
   */
  public $objectName = null;
  /**
   * @var string[]
   */
  public $partValues = null;
  /**
   * @var string
   */
  public $columnName = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'objectType',
          'type' => TType::I32,
          ),
        2 => array(
          'var' => 'dbName',
          'type' => TType::STRING,
          ),
        3 => array(
          'var' => 'objectName',
          'type' => TType::STRING,
          ),
        4 => array(
          'var' => 'partValues',
          'type' => TType::LST,
          'etype' => TType::STRING,
          'elem' => array(
            'type' => TType::STRING,
            ),
          ),
        5 => array(
          'var' => 'columnName',
          'type' => TType::STRING,
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['objectType'])) {
        $this->objectType = $vals['objectType'];
      }
      if (isset($vals['dbName'])) {
        $this->dbName = $vals['dbName'];
      }
      if (isset($vals['objectName'])) {
        $this->objectName = $vals['objectName'];
      }
      if (isset($vals['partValues'])) {
        $this->partValues = $vals['partValues'];
      }
      if (isset($vals['columnName'])) {
        $this->columnName = $vals['columnName'];
      }
    }
  }

  public function getName() {
    return 'HiveObjectRef';
  }

  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->objectType);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 2:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->dbName);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 3:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->objectName);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 4:
          if ($ftype == TType::LST) {
            $this->partValues = array();
            $_size7 = 0;
            $_etype10 = 0;
            $xfer += $input->readListBegin($_etype10, $_size7);
            for ($_i11 = 0; $_i11 < $_size7; ++$_i11)
            {
              $elem12 = null;
              $xfer += $input->readString($elem12);
              $this->partValues []= $elem12;
            }
            $xfer += $input->readListEnd();
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 5:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->columnName);
          } 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('HiveObjectRef');
    if ($this->objectType !== null) {
      $xfer += $output->writeFieldBegin('objectType', TType::I32, 1);
      $xfer += $output->writeI32($this->objectType);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->dbName !== null) {
      $xfer += $output->writeFieldBegin('dbName', TType::STRING, 2);
      $xfer += $output->writeString($this->dbName);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->objectName !== null) {
      $xfer += $output->writeFieldBegin('objectName', TType::STRING, 3);
      $xfer += $output->writeString($this->objectName);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->partValues !== null) {
      if (!is_array($this->partValues)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('partValues', TType::LST, 4);
      {
        $output->writeListBegin(TType::STRING, count($this->partValues));
        {
          foreach ($this->partValues as $iter13)
          {
            $xfer += $output->writeString($iter13);
          }
        }
        $output->writeListEnd();
      }
      $xfer += $output->writeFieldEnd();
    }
    if ($this->columnName !== null) {
      $xfer += $output->writeFieldBegin('columnName', TType::STRING, 5);
      $xfer += $output->writeString($this->columnName);
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class PrivilegeGrantInfo {
  static $_TSPEC;

  /**
   * @var string
   */
  public $privilege = null;
  /**
   * @var int
   */
  public $createTime = null;
  /**
   * @var string
   */
  public $grantor = null;
  /**
   * @var int
   */
  public $grantorType = null;
  /**
   * @var bool
   */
  public $grantOption = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'privilege',
          'type' => TType::STRING,
          ),
        2 => array(
          'var' => 'createTime',
          'type' => TType::I32,
          ),
        3 => array(
          'var' => 'grantor',
          'type' => TType::STRING,
          ),
        4 => array(
          'var' => 'grantorType',
          'type' => TType::I32,
          ),
        5 => array(
          'var' => 'grantOption',
          'type' => TType::BOOL,
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['privilege'])) {
        $this->privilege = $vals['privilege'];
      }
      if (isset($vals['createTime'])) {
        $this->createTime = $vals['createTime'];
      }
      if (isset($vals['grantor'])) {
        $this->grantor = $vals['grantor'];
      }
      if (isset($vals['grantorType'])) {
        $this->grantorType = $vals['grantorType'];
      }
      if (isset($vals['grantOption'])) {
        $this->grantOption = $vals['grantOption'];
      }
    }
  }

  public function getName() {
    return 'PrivilegeGrantInfo';
  }

  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->privilege);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 2:
          if ($ftype == TType::I32) {
            $xfer += $input->readI32($this->createTime);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 3:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->grantor);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 4:
          if ($ftype == TType::I32) {
            $xfer += $input->readI32($this->grantorType);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 5:
          if ($ftype == TType::BOOL) {
            $xfer += $input->readBool($this->grantOption);
          } 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('PrivilegeGrantInfo');
    if ($this->privilege !== null) {
      $xfer += $output->writeFieldBegin('privilege', TType::STRING, 1);
      $xfer += $output->writeString($this->privilege);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->createTime !== null) {
      $xfer += $output->writeFieldBegin('createTime', TType::I32, 2);
      $xfer += $output->writeI32($this->createTime);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->grantor !== null) {
      $xfer += $output->writeFieldBegin('grantor', TType::STRING, 3);
      $xfer += $output->writeString($this->grantor);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->grantorType !== null) {
      $xfer += $output->writeFieldBegin('grantorType', TType::I32, 4);
      $xfer += $output->writeI32($this->grantorType);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->grantOption !== null) {
      $xfer += $output->writeFieldBegin('grantOption', TType::BOOL, 5);
      $xfer += $output->writeBool($this->grantOption);
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class HiveObjectPrivilege {
  static $_TSPEC;

  /**
   * @var \metastore\HiveObjectRef
   */
  public $hiveObject = null;
  /**
   * @var string
   */
  public $principalName = null;
  /**
   * @var int
   */
  public $principalType = null;
  /**
   * @var \metastore\PrivilegeGrantInfo
   */
  public $grantInfo = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'hiveObject',
          'type' => TType::STRUCT,
          'class' => '\metastore\HiveObjectRef',
          ),
        2 => array(
          'var' => 'principalName',
          'type' => TType::STRING,
          ),
        3 => array(
          'var' => 'principalType',
          'type' => TType::I32,
          ),
        4 => array(
          'var' => 'grantInfo',
          'type' => TType::STRUCT,
          'class' => '\metastore\PrivilegeGrantInfo',
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['hiveObject'])) {
        $this->hiveObject = $vals['hiveObject'];
      }
      if (isset($vals['principalName'])) {
        $this->principalName = $vals['principalName'];
      }
      if (isset($vals['principalType'])) {
        $this->principalType = $vals['principalType'];
      }
      if (isset($vals['grantInfo'])) {
        $this->grantInfo = $vals['grantInfo'];
      }
    }
  }

  public function getName() {
    return 'HiveObjectPrivilege';
  }

  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::STRUCT) {
            $this->hiveObject = new \metastore\HiveObjectRef();
            $xfer += $this->hiveObject->read($input);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 2:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->principalName);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 3:
          if ($ftype == TType::I32) {
            $xfer += $input->readI32($this->principalType);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 4:
          if ($ftype == TType::STRUCT) {
            $this->grantInfo = new \metastore\PrivilegeGrantInfo();
            $xfer += $this->grantInfo->read($input);
          } 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('HiveObjectPrivilege');
    if ($this->hiveObject !== null) {
      if (!is_object($this->hiveObject)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('hiveObject', TType::STRUCT, 1);
      $xfer += $this->hiveObject->write($output);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->principalName !== null) {
      $xfer += $output->writeFieldBegin('principalName', TType::STRING, 2);
      $xfer += $output->writeString($this->principalName);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->principalType !== null) {
      $xfer += $output->writeFieldBegin('principalType', TType::I32, 3);
      $xfer += $output->writeI32($this->principalType);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->grantInfo !== null) {
      if (!is_object($this->grantInfo)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('grantInfo', TType::STRUCT, 4);
      $xfer += $this->grantInfo->write($output);
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class PrivilegeBag {
  static $_TSPEC;

  /**
   * @var \metastore\HiveObjectPrivilege[]
   */
  public $privileges = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'privileges',
          'type' => TType::LST,
          'etype' => TType::STRUCT,
          'elem' => array(
            'type' => TType::STRUCT,
            'class' => '\metastore\HiveObjectPrivilege',
            ),
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['privileges'])) {
        $this->privileges = $vals['privileges'];
      }
    }
  }

  public function getName() {
    return 'PrivilegeBag';
  }

  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->privileges = array();
            $_size14 = 0;
            $_etype17 = 0;
            $xfer += $input->readListBegin($_etype17, $_size14);
            for ($_i18 = 0; $_i18 < $_size14; ++$_i18)
            {
              $elem19 = null;
              $elem19 = new \metastore\HiveObjectPrivilege();
              $xfer += $elem19->read($input);
              $this->privileges []= $elem19;
            }
            $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('PrivilegeBag');
    if ($this->privileges !== null) {
      if (!is_array($this->privileges)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('privileges', TType::LST, 1);
      {
        $output->writeListBegin(TType::STRUCT, count($this->privileges));
        {
          foreach ($this->privileges as $iter20)
          {
            $xfer += $iter20->write($output);
          }
        }
        $output->writeListEnd();
      }
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class PrincipalPrivilegeSet {
  static $_TSPEC;

  /**
   * @var array
   */
  public $userPrivileges = null;
  /**
   * @var array
   */
  public $groupPrivileges = null;
  /**
   * @var array
   */
  public $rolePrivileges = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'userPrivileges',
          'type' => TType::MAP,
          'ktype' => TType::STRING,
          'vtype' => TType::LST,
          'key' => array(
            'type' => TType::STRING,
          ),
          'val' => array(
            'type' => TType::LST,
            'etype' => TType::STRUCT,
            'elem' => array(
              'type' => TType::STRUCT,
              'class' => '\metastore\PrivilegeGrantInfo',
              ),
            ),
          ),
        2 => array(
          'var' => 'groupPrivileges',
          'type' => TType::MAP,
          'ktype' => TType::STRING,
          'vtype' => TType::LST,
          'key' => array(
            'type' => TType::STRING,
          ),
          'val' => array(
            'type' => TType::LST,
            'etype' => TType::STRUCT,
            'elem' => array(
              'type' => TType::STRUCT,
              'class' => '\metastore\PrivilegeGrantInfo',
              ),
            ),
          ),
        3 => array(
          'var' => 'rolePrivileges',
          'type' => TType::MAP,
          'ktype' => TType::STRING,
          'vtype' => TType::LST,
          'key' => array(
            'type' => TType::STRING,
          ),
          'val' => array(
            'type' => TType::LST,
            'etype' => TType::STRUCT,
            'elem' => array(
              'type' => TType::STRUCT,
              'class' => '\metastore\PrivilegeGrantInfo',
              ),
            ),
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['userPrivileges'])) {
        $this->userPrivileges = $vals['userPrivileges'];
      }
      if (isset($vals['groupPrivileges'])) {
        $this->groupPrivileges = $vals['groupPrivileges'];
      }
      if (isset($vals['rolePrivileges'])) {
        $this->rolePrivileges = $vals['rolePrivileges'];
      }
    }
  }

  public function getName() {
    return 'PrincipalPrivilegeSet';
  }

  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::MAP) {
            $this->userPrivileges = array();
            $_size21 = 0;
            $_ktype22 = 0;
            $_vtype23 = 0;
            $xfer += $input->readMapBegin($_ktype22, $_vtype23, $_size21);
            for ($_i25 = 0; $_i25 < $_size21; ++$_i25)
            {
              $key26 = '';
              $val27 = array();
              $xfer += $input->readString($key26);
              $val27 = array();
              $_size28 = 0;
              $_etype31 = 0;
              $xfer += $input->readListBegin($_etype31, $_size28);
              for ($_i32 = 0; $_i32 < $_size28; ++$_i32)
              {
                $elem33 = null;
                $elem33 = new \metastore\PrivilegeGrantInfo();
                $xfer += $elem33->read($input);
                $val27 []= $elem33;
              }
              $xfer += $input->readListEnd();
              $this->userPrivileges[$key26] = $val27;
            }
            $xfer += $input->readMapEnd();
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 2:
          if ($ftype == TType::MAP) {
            $this->groupPrivileges = array();
            $_size34 = 0;
            $_ktype35 = 0;
            $_vtype36 = 0;
            $xfer += $input->readMapBegin($_ktype35, $_vtype36, $_size34);
            for ($_i38 = 0; $_i38 < $_size34; ++$_i38)
            {
              $key39 = '';
              $val40 = array();
              $xfer += $input->readString($key39);
              $val40 = array();
              $_size41 = 0;
              $_etype44 = 0;
              $xfer += $input->readListBegin($_etype44, $_size41);
              for ($_i45 = 0; $_i45 < $_size41; ++$_i45)
              {
                $elem46 = null;
                $elem46 = new \metastore\PrivilegeGrantInfo();
                $xfer += $elem46->read($input);
                $val40 []= $elem46;
              }
              $xfer += $input->readListEnd();
              $this->groupPrivileges[$key39] = $val40;
            }
            $xfer += $input->readMapEnd();
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 3:
          if ($ftype == TType::MAP) {
            $this->rolePrivileges = array();
            $_size47 = 0;
            $_ktype48 = 0;
            $_vtype49 = 0;
            $xfer += $input->readMapBegin($_ktype48, $_vtype49, $_size47);
            for ($_i51 = 0; $_i51 < $_size47; ++$_i51)
            {
              $key52 = '';
              $val53 = array();
              $xfer += $input->readString($key52);
              $val53 = array();
              $_size54 = 0;
              $_etype57 = 0;
              $xfer += $input->readListBegin($_etype57, $_size54);
              for ($_i58 = 0; $_i58 < $_size54; ++$_i58)
              {
                $elem59 = null;
                $elem59 = new \metastore\PrivilegeGrantInfo();
                $xfer += $elem59->read($input);
                $val53 []= $elem59;
              }
              $xfer += $input->readListEnd();
              $this->rolePrivileges[$key52] = $val53;
            }
            $xfer += $input->readMapEnd();
          } 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('PrincipalPrivilegeSet');
    if ($this->userPrivileges !== null) {
      if (!is_array($this->userPrivileges)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('userPrivileges', TType::MAP, 1);
      {
        $output->writeMapBegin(TType::STRING, TType::LST, count($this->userPrivileges));
        {
          foreach ($this->userPrivileges as $kiter60 => $viter61)
          {
            $xfer += $output->writeString($kiter60);
            {
              $output->writeListBegin(TType::STRUCT, count($viter61));
              {
                foreach ($viter61 as $iter62)
                {
                  $xfer += $iter62->write($output);
                }
              }
              $output->writeListEnd();
            }
          }
        }
        $output->writeMapEnd();
      }
      $xfer += $output->writeFieldEnd();
    }
    if ($this->groupPrivileges !== null) {
      if (!is_array($this->groupPrivileges)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('groupPrivileges', TType::MAP, 2);
      {
        $output->writeMapBegin(TType::STRING, TType::LST, count($this->groupPrivileges));
        {
          foreach ($this->groupPrivileges as $kiter63 => $viter64)
          {
            $xfer += $output->writeString($kiter63);
            {
              $output->writeListBegin(TType::STRUCT, count($viter64));
              {
                foreach ($viter64 as $iter65)
                {
                  $xfer += $iter65->write($output);
                }
              }
              $output->writeListEnd();
            }
          }
        }
        $output->writeMapEnd();
      }
      $xfer += $output->writeFieldEnd();
    }
    if ($this->rolePrivileges !== null) {
      if (!is_array($this->rolePrivileges)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('rolePrivileges', TType::MAP, 3);
      {
        $output->writeMapBegin(TType::STRING, TType::LST, count($this->rolePrivileges));
        {
          foreach ($this->rolePrivileges as $kiter66 => $viter67)
          {
            $xfer += $output->writeString($kiter66);
            {
              $output->writeListBegin(TType::STRUCT, count($viter67));
              {
                foreach ($viter67 as $iter68)
                {
                  $xfer += $iter68->write($output);
                }
              }
              $output->writeListEnd();
            }
          }
        }
        $output->writeMapEnd();
      }
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class GrantRevokePrivilegeRequest {
  static $_TSPEC;

  /**
   * @var int
   */
  public $requestType = null;
  /**
   * @var \metastore\PrivilegeBag
   */
  public $privileges = null;
  /**
   * @var bool
   */
  public $revokeGrantOption = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'requestType',
          'type' => TType::I32,
          ),
        2 => array(
          'var' => 'privileges',
          'type' => TType::STRUCT,
          'class' => '\metastore\PrivilegeBag',
          ),
        3 => array(
          'var' => 'revokeGrantOption',
          'type' => TType::BOOL,
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['requestType'])) {
        $this->requestType = $vals['requestType'];
      }
      if (isset($vals['privileges'])) {
        $this->privileges = $vals['privileges'];
      }
      if (isset($vals['revokeGrantOption'])) {
        $this->revokeGrantOption = $vals['revokeGrantOption'];
      }
    }
  }

  public function getName() {
    return 'GrantRevokePrivilegeRequest';
  }

  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->requestType);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 2:
          if ($ftype == TType::STRUCT) {
            $this->privileges = new \metastore\PrivilegeBag();
            $xfer += $this->privileges->read($input);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 3:
          if ($ftype == TType::BOOL) {
            $xfer += $input->readBool($this->revokeGrantOption);
          } 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('GrantRevokePrivilegeRequest');
    if ($this->requestType !== null) {
      $xfer += $output->writeFieldBegin('requestType', TType::I32, 1);
      $xfer += $output->writeI32($this->requestType);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->privileges !== null) {
      if (!is_object($this->privileges)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('privileges', TType::STRUCT, 2);
      $xfer += $this->privileges->write($output);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->revokeGrantOption !== null) {
      $xfer += $output->writeFieldBegin('revokeGrantOption', TType::BOOL, 3);
      $xfer += $output->writeBool($this->revokeGrantOption);
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class GrantRevokePrivilegeResponse {
  static $_TSPEC;

  /**
   * @var bool
   */
  public $success = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'success',
          'type' => TType::BOOL,
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['success'])) {
        $this->success = $vals['success'];
      }
    }
  }

  public function getName() {
    return 'GrantRevokePrivilegeResponse';
  }

  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::BOOL) {
            $xfer += $input->readBool($this->success);
          } 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('GrantRevokePrivilegeResponse');
    if ($this->success !== null) {
      $xfer += $output->writeFieldBegin('success', TType::BOOL, 1);
      $xfer += $output->writeBool($this->success);
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class Role {
  static $_TSPEC;

  /**
   * @var string
   */
  public $roleName = null;
  /**
   * @var int
   */
  public $createTime = null;
  /**
   * @var string
   */
  public $ownerName = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'roleName',
          'type' => TType::STRING,
          ),
        2 => array(
          'var' => 'createTime',
          'type' => TType::I32,
          ),
        3 => array(
          'var' => 'ownerName',
          'type' => TType::STRING,
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['roleName'])) {
        $this->roleName = $vals['roleName'];
      }
      if (isset($vals['createTime'])) {
        $this->createTime = $vals['createTime'];
      }
      if (isset($vals['ownerName'])) {
        $this->ownerName = $vals['ownerName'];
      }
    }
  }

  public function getName() {
    return 'Role';
  }

  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->roleName);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 2:
          if ($ftype == TType::I32) {
            $xfer += $input->readI32($this->createTime);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 3:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->ownerName);
          } 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('Role');
    if ($this->roleName !== null) {
      $xfer += $output->writeFieldBegin('roleName', TType::STRING, 1);
      $xfer += $output->writeString($this->roleName);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->createTime !== null) {
      $xfer += $output->writeFieldBegin('createTime', TType::I32, 2);
      $xfer += $output->writeI32($this->createTime);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->ownerName !== null) {
      $xfer += $output->writeFieldBegin('ownerName', TType::STRING, 3);
      $xfer += $output->writeString($this->ownerName);
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class RolePrincipalGrant {
  static $_TSPEC;

  /**
   * @var string
   */
  public $roleName = null;
  /**
   * @var string
   */
  public $principalName = null;
  /**
   * @var int
   */
  public $principalType = null;
  /**
   * @var bool
   */
  public $grantOption = null;
  /**
   * @var int
   */
  public $grantTime = null;
  /**
   * @var string
   */
  public $grantorName = null;
  /**
   * @var int
   */
  public $grantorPrincipalType = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'roleName',
          'type' => TType::STRING,
          ),
        2 => array(
          'var' => 'principalName',
          'type' => TType::STRING,
          ),
        3 => array(
          'var' => 'principalType',
          'type' => TType::I32,
          ),
        4 => array(
          'var' => 'grantOption',
          'type' => TType::BOOL,
          ),
        5 => array(
          'var' => 'grantTime',
          'type' => TType::I32,
          ),
        6 => array(
          'var' => 'grantorName',
          'type' => TType::STRING,
          ),
        7 => array(
          'var' => 'grantorPrincipalType',
          'type' => TType::I32,
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['roleName'])) {
        $this->roleName = $vals['roleName'];
      }
      if (isset($vals['principalName'])) {
        $this->principalName = $vals['principalName'];
      }
      if (isset($vals['principalType'])) {
        $this->principalType = $vals['principalType'];
      }
      if (isset($vals['grantOption'])) {
        $this->grantOption = $vals['grantOption'];
      }
      if (isset($vals['grantTime'])) {
        $this->grantTime = $vals['grantTime'];
      }
      if (isset($vals['grantorName'])) {
        $this->grantorName = $vals['grantorName'];
      }
      if (isset($vals['grantorPrincipalType'])) {
        $this->grantorPrincipalType = $vals['grantorPrincipalType'];
      }
    }
  }

  public function getName() {
    return 'RolePrincipalGrant';
  }

  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->roleName);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 2:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->principalName);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 3:
          if ($ftype == TType::I32) {
            $xfer += $input->readI32($this->principalType);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 4:
          if ($ftype == TType::BOOL) {
            $xfer += $input->readBool($this->grantOption);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 5:
          if ($ftype == TType::I32) {
            $xfer += $input->readI32($this->grantTime);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 6:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->grantorName);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 7:
          if ($ftype == TType::I32) {
            $xfer += $input->readI32($this->grantorPrincipalType);
          } 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('RolePrincipalGrant');
    if ($this->roleName !== null) {
      $xfer += $output->writeFieldBegin('roleName', TType::STRING, 1);
      $xfer += $output->writeString($this->roleName);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->principalName !== null) {
      $xfer += $output->writeFieldBegin('principalName', TType::STRING, 2);
      $xfer += $output->writeString($this->principalName);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->principalType !== null) {
      $xfer += $output->writeFieldBegin('principalType', TType::I32, 3);
      $xfer += $output->writeI32($this->principalType);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->grantOption !== null) {
      $xfer += $output->writeFieldBegin('grantOption', TType::BOOL, 4);
      $xfer += $output->writeBool($this->grantOption);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->grantTime !== null) {
      $xfer += $output->writeFieldBegin('grantTime', TType::I32, 5);
      $xfer += $output->writeI32($this->grantTime);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->grantorName !== null) {
      $xfer += $output->writeFieldBegin('grantorName', TType::STRING, 6);
      $xfer += $output->writeString($this->grantorName);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->grantorPrincipalType !== null) {
      $xfer += $output->writeFieldBegin('grantorPrincipalType', TType::I32, 7);
      $xfer += $output->writeI32($this->grantorPrincipalType);
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class GetRoleGrantsForPrincipalRequest {
  static $_TSPEC;

  /**
   * @var string
   */
  public $principal_name = null;
  /**
   * @var int
   */
  public $principal_type = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'principal_name',
          'type' => TType::STRING,
          ),
        2 => array(
          'var' => 'principal_type',
          'type' => TType::I32,
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['principal_name'])) {
        $this->principal_name = $vals['principal_name'];
      }
      if (isset($vals['principal_type'])) {
        $this->principal_type = $vals['principal_type'];
      }
    }
  }

  public function getName() {
    return 'GetRoleGrantsForPrincipalRequest';
  }

  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->principal_name);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 2:
          if ($ftype == TType::I32) {
            $xfer += $input->readI32($this->principal_type);
          } 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('GetRoleGrantsForPrincipalRequest');
    if ($this->principal_name !== null) {
      $xfer += $output->writeFieldBegin('principal_name', TType::STRING, 1);
      $xfer += $output->writeString($this->principal_name);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->principal_type !== null) {
      $xfer += $output->writeFieldBegin('principal_type', TType::I32, 2);
      $xfer += $output->writeI32($this->principal_type);
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class GetRoleGrantsForPrincipalResponse {
  static $_TSPEC;

  /**
   * @var \metastore\RolePrincipalGrant[]
   */
  public $principalGrants = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'principalGrants',
          'type' => TType::LST,
          'etype' => TType::STRUCT,
          'elem' => array(
            'type' => TType::STRUCT,
            'class' => '\metastore\RolePrincipalGrant',
            ),
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['principalGrants'])) {
        $this->principalGrants = $vals['principalGrants'];
      }
    }
  }

  public function getName() {
    return 'GetRoleGrantsForPrincipalResponse';
  }

  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->principalGrants = array();
            $_size69 = 0;
            $_etype72 = 0;
            $xfer += $input->readListBegin($_etype72, $_size69);
            for ($_i73 = 0; $_i73 < $_size69; ++$_i73)
            {
              $elem74 = null;
              $elem74 = new \metastore\RolePrincipalGrant();
              $xfer += $elem74->read($input);
              $this->principalGrants []= $elem74;
            }
            $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('GetRoleGrantsForPrincipalResponse');
    if ($this->principalGrants !== null) {
      if (!is_array($this->principalGrants)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('principalGrants', TType::LST, 1);
      {
        $output->writeListBegin(TType::STRUCT, count($this->principalGrants));
        {
          foreach ($this->principalGrants as $iter75)
          {
            $xfer += $iter75->write($output);
          }
        }
        $output->writeListEnd();
      }
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class GetPrincipalsInRoleRequest {
  static $_TSPEC;

  /**
   * @var string
   */
  public $roleName = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'roleName',
          'type' => TType::STRING,
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['roleName'])) {
        $this->roleName = $vals['roleName'];
      }
    }
  }

  public function getName() {
    return 'GetPrincipalsInRoleRequest';
  }

  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->roleName);
          } 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('GetPrincipalsInRoleRequest');
    if ($this->roleName !== null) {
      $xfer += $output->writeFieldBegin('roleName', TType::STRING, 1);
      $xfer += $output->writeString($this->roleName);
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class GetPrincipalsInRoleResponse {
  static $_TSPEC;

  /**
   * @var \metastore\RolePrincipalGrant[]
   */
  public $principalGrants = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'principalGrants',
          'type' => TType::LST,
          'etype' => TType::STRUCT,
          'elem' => array(
            'type' => TType::STRUCT,
            'class' => '\metastore\RolePrincipalGrant',
            ),
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['principalGrants'])) {
        $this->principalGrants = $vals['principalGrants'];
      }
    }
  }

  public function getName() {
    return 'GetPrincipalsInRoleResponse';
  }

  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->principalGrants = array();
            $_size76 = 0;
            $_etype79 = 0;
            $xfer += $input->readListBegin($_etype79, $_size76);
            for ($_i80 = 0; $_i80 < $_size76; ++$_i80)
            {
              $elem81 = null;
              $elem81 = new \metastore\RolePrincipalGrant();
              $xfer += $elem81->read($input);
              $this->principalGrants []= $elem81;
            }
            $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('GetPrincipalsInRoleResponse');
    if ($this->principalGrants !== null) {
      if (!is_array($this->principalGrants)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('principalGrants', TType::LST, 1);
      {
        $output->writeListBegin(TType::STRUCT, count($this->principalGrants));
        {
          foreach ($this->principalGrants as $iter82)
          {
            $xfer += $iter82->write($output);
          }
        }
        $output->writeListEnd();
      }
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class GrantRevokeRoleRequest {
  static $_TSPEC;

  /**
   * @var int
   */
  public $requestType = null;
  /**
   * @var string
   */
  public $roleName = null;
  /**
   * @var string
   */
  public $principalName = null;
  /**
   * @var int
   */
  public $principalType = null;
  /**
   * @var string
   */
  public $grantor = null;
  /**
   * @var int
   */
  public $grantorType = null;
  /**
   * @var bool
   */
  public $grantOption = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'requestType',
          'type' => TType::I32,
          ),
        2 => array(
          'var' => 'roleName',
          'type' => TType::STRING,
          ),
        3 => array(
          'var' => 'principalName',
          'type' => TType::STRING,
          ),
        4 => array(
          'var' => 'principalType',
          'type' => TType::I32,
          ),
        5 => array(
          'var' => 'grantor',
          'type' => TType::STRING,
          ),
        6 => array(
          'var' => 'grantorType',
          'type' => TType::I32,
          ),
        7 => array(
          'var' => 'grantOption',
          'type' => TType::BOOL,
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['requestType'])) {
        $this->requestType = $vals['requestType'];
      }
      if (isset($vals['roleName'])) {
        $this->roleName = $vals['roleName'];
      }
      if (isset($vals['principalName'])) {
        $this->principalName = $vals['principalName'];
      }
      if (isset($vals['principalType'])) {
        $this->principalType = $vals['principalType'];
      }
      if (isset($vals['grantor'])) {
        $this->grantor = $vals['grantor'];
      }
      if (isset($vals['grantorType'])) {
        $this->grantorType = $vals['grantorType'];
      }
      if (isset($vals['grantOption'])) {
        $this->grantOption = $vals['grantOption'];
      }
    }
  }

  public function getName() {
    return 'GrantRevokeRoleRequest';
  }

  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->requestType);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 2:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->roleName);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 3:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->principalName);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 4:
          if ($ftype == TType::I32) {
            $xfer += $input->readI32($this->principalType);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 5:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->grantor);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 6:
          if ($ftype == TType::I32) {
            $xfer += $input->readI32($this->grantorType);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 7:
          if ($ftype == TType::BOOL) {
            $xfer += $input->readBool($this->grantOption);
          } 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('GrantRevokeRoleRequest');
    if ($this->requestType !== null) {
      $xfer += $output->writeFieldBegin('requestType', TType::I32, 1);
      $xfer += $output->writeI32($this->requestType);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->roleName !== null) {
      $xfer += $output->writeFieldBegin('roleName', TType::STRING, 2);
      $xfer += $output->writeString($this->roleName);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->principalName !== null) {
      $xfer += $output->writeFieldBegin('principalName', TType::STRING, 3);
      $xfer += $output->writeString($this->principalName);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->principalType !== null) {
      $xfer += $output->writeFieldBegin('principalType', TType::I32, 4);
      $xfer += $output->writeI32($this->principalType);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->grantor !== null) {
      $xfer += $output->writeFieldBegin('grantor', TType::STRING, 5);
      $xfer += $output->writeString($this->grantor);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->grantorType !== null) {
      $xfer += $output->writeFieldBegin('grantorType', TType::I32, 6);
      $xfer += $output->writeI32($this->grantorType);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->grantOption !== null) {
      $xfer += $output->writeFieldBegin('grantOption', TType::BOOL, 7);
      $xfer += $output->writeBool($this->grantOption);
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class GrantRevokeRoleResponse {
  static $_TSPEC;

  /**
   * @var bool
   */
  public $success = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'success',
          'type' => TType::BOOL,
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['success'])) {
        $this->success = $vals['success'];
      }
    }
  }

  public function getName() {
    return 'GrantRevokeRoleResponse';
  }

  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::BOOL) {
            $xfer += $input->readBool($this->success);
          } 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('GrantRevokeRoleResponse');
    if ($this->success !== null) {
      $xfer += $output->writeFieldBegin('success', TType::BOOL, 1);
      $xfer += $output->writeBool($this->success);
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class Database {
  static $_TSPEC;

  /**
   * @var string
   */
  public $name = null;
  /**
   * @var string
   */
  public $description = null;
  /**
   * @var string
   */
  public $locationUri = null;
  /**
   * @var array
   */
  public $parameters = null;
  /**
   * @var \metastore\PrincipalPrivilegeSet
   */
  public $privileges = null;
  /**
   * @var string
   */
  public $ownerName = null;
  /**
   * @var int
   */
  public $ownerType = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'name',
          'type' => TType::STRING,
          ),
        2 => array(
          'var' => 'description',
          'type' => TType::STRING,
          ),
        3 => array(
          'var' => 'locationUri',
          'type' => TType::STRING,
          ),
        4 => array(
          'var' => 'parameters',
          'type' => TType::MAP,
          'ktype' => TType::STRING,
          'vtype' => TType::STRING,
          'key' => array(
            'type' => TType::STRING,
          ),
          'val' => array(
            'type' => TType::STRING,
            ),
          ),
        5 => array(
          'var' => 'privileges',
          'type' => TType::STRUCT,
          'class' => '\metastore\PrincipalPrivilegeSet',
          ),
        6 => array(
          'var' => 'ownerName',
          'type' => TType::STRING,
          ),
        7 => array(
          'var' => 'ownerType',
          'type' => TType::I32,
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['name'])) {
        $this->name = $vals['name'];
      }
      if (isset($vals['description'])) {
        $this->description = $vals['description'];
      }
      if (isset($vals['locationUri'])) {
        $this->locationUri = $vals['locationUri'];
      }
      if (isset($vals['parameters'])) {
        $this->parameters = $vals['parameters'];
      }
      if (isset($vals['privileges'])) {
        $this->privileges = $vals['privileges'];
      }
      if (isset($vals['ownerName'])) {
        $this->ownerName = $vals['ownerName'];
      }
      if (isset($vals['ownerType'])) {
        $this->ownerType = $vals['ownerType'];
      }
    }
  }

  public function getName() {
    return 'Database';
  }

  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->name);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 2:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->description);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 3:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->locationUri);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 4:
          if ($ftype == TType::MAP) {
            $this->parameters = array();
            $_size83 = 0;
            $_ktype84 = 0;
            $_vtype85 = 0;
            $xfer += $input->readMapBegin($_ktype84, $_vtype85, $_size83);
            for ($_i87 = 0; $_i87 < $_size83; ++$_i87)
            {
              $key88 = '';
              $val89 = '';
              $xfer += $input->readString($key88);
              $xfer += $input->readString($val89);
              $this->parameters[$key88] = $val89;
            }
            $xfer += $input->readMapEnd();
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 5:
          if ($ftype == TType::STRUCT) {
            $this->privileges = new \metastore\PrincipalPrivilegeSet();
            $xfer += $this->privileges->read($input);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 6:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->ownerName);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 7:
          if ($ftype == TType::I32) {
            $xfer += $input->readI32($this->ownerType);
          } 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('Database');
    if ($this->name !== null) {
      $xfer += $output->writeFieldBegin('name', TType::STRING, 1);
      $xfer += $output->writeString($this->name);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->description !== null) {
      $xfer += $output->writeFieldBegin('description', TType::STRING, 2);
      $xfer += $output->writeString($this->description);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->locationUri !== null) {
      $xfer += $output->writeFieldBegin('locationUri', TType::STRING, 3);
      $xfer += $output->writeString($this->locationUri);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->parameters !== null) {
      if (!is_array($this->parameters)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('parameters', TType::MAP, 4);
      {
        $output->writeMapBegin(TType::STRING, TType::STRING, count($this->parameters));
        {
          foreach ($this->parameters as $kiter90 => $viter91)
          {
            $xfer += $output->writeString($kiter90);
            $xfer += $output->writeString($viter91);
          }
        }
        $output->writeMapEnd();
      }
      $xfer += $output->writeFieldEnd();
    }
    if ($this->privileges !== null) {
      if (!is_object($this->privileges)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('privileges', TType::STRUCT, 5);
      $xfer += $this->privileges->write($output);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->ownerName !== null) {
      $xfer += $output->writeFieldBegin('ownerName', TType::STRING, 6);
      $xfer += $output->writeString($this->ownerName);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->ownerType !== null) {
      $xfer += $output->writeFieldBegin('ownerType', TType::I32, 7);
      $xfer += $output->writeI32($this->ownerType);
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class SerDeInfo {
  static $_TSPEC;

  /**
   * @var string
   */
  public $name = null;
  /**
   * @var string
   */
  public $serializationLib = null;
  /**
   * @var array
   */
  public $parameters = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'name',
          'type' => TType::STRING,
          ),
        2 => array(
          'var' => 'serializationLib',
          'type' => TType::STRING,
          ),
        3 => array(
          'var' => 'parameters',
          'type' => TType::MAP,
          'ktype' => TType::STRING,
          'vtype' => TType::STRING,
          'key' => array(
            'type' => TType::STRING,
          ),
          'val' => array(
            'type' => TType::STRING,
            ),
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['name'])) {
        $this->name = $vals['name'];
      }
      if (isset($vals['serializationLib'])) {
        $this->serializationLib = $vals['serializationLib'];
      }
      if (isset($vals['parameters'])) {
        $this->parameters = $vals['parameters'];
      }
    }
  }

  public function getName() {
    return 'SerDeInfo';
  }

  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->name);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 2:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->serializationLib);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 3:
          if ($ftype == TType::MAP) {
            $this->parameters = array();
            $_size92 = 0;
            $_ktype93 = 0;
            $_vtype94 = 0;
            $xfer += $input->readMapBegin($_ktype93, $_vtype94, $_size92);
            for ($_i96 = 0; $_i96 < $_size92; ++$_i96)
            {
              $key97 = '';
              $val98 = '';
              $xfer += $input->readString($key97);
              $xfer += $input->readString($val98);
              $this->parameters[$key97] = $val98;
            }
            $xfer += $input->readMapEnd();
          } 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('SerDeInfo');
    if ($this->name !== null) {
      $xfer += $output->writeFieldBegin('name', TType::STRING, 1);
      $xfer += $output->writeString($this->name);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->serializationLib !== null) {
      $xfer += $output->writeFieldBegin('serializationLib', TType::STRING, 2);
      $xfer += $output->writeString($this->serializationLib);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->parameters !== null) {
      if (!is_array($this->parameters)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('parameters', TType::MAP, 3);
      {
        $output->writeMapBegin(TType::STRING, TType::STRING, count($this->parameters));
        {
          foreach ($this->parameters as $kiter99 => $viter100)
          {
            $xfer += $output->writeString($kiter99);
            $xfer += $output->writeString($viter100);
          }
        }
        $output->writeMapEnd();
      }
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class Order {
  static $_TSPEC;

  /**
   * @var string
   */
  public $col = null;
  /**
   * @var int
   */
  public $order = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'col',
          'type' => TType::STRING,
          ),
        2 => array(
          'var' => 'order',
          'type' => TType::I32,
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['col'])) {
        $this->col = $vals['col'];
      }
      if (isset($vals['order'])) {
        $this->order = $vals['order'];
      }
    }
  }

  public function getName() {
    return 'Order';
  }

  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->col);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 2:
          if ($ftype == TType::I32) {
            $xfer += $input->readI32($this->order);
          } 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('Order');
    if ($this->col !== null) {
      $xfer += $output->writeFieldBegin('col', TType::STRING, 1);
      $xfer += $output->writeString($this->col);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->order !== null) {
      $xfer += $output->writeFieldBegin('order', TType::I32, 2);
      $xfer += $output->writeI32($this->order);
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class SkewedInfo {
  static $_TSPEC;

  /**
   * @var string[]
   */
  public $skewedColNames = null;
  /**
   * @var (string[])[]
   */
  public $skewedColValues = null;
  /**
   * @var array
   */
  public $skewedColValueLocationMaps = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'skewedColNames',
          'type' => TType::LST,
          'etype' => TType::STRING,
          'elem' => array(
            'type' => TType::STRING,
            ),
          ),
        2 => array(
          'var' => 'skewedColValues',
          'type' => TType::LST,
          'etype' => TType::LST,
          'elem' => array(
            'type' => TType::LST,
            'etype' => TType::STRING,
            'elem' => array(
              'type' => TType::STRING,
              ),
            ),
          ),
        3 => array(
          'var' => 'skewedColValueLocationMaps',
          'type' => TType::MAP,
          'ktype' => TType::LST,
          'vtype' => TType::STRING,
          'key' => array(
            'type' => TType::LST,
            'etype' => TType::STRING,
            'elem' => array(
              'type' => TType::STRING,
              ),
          ),
          'val' => array(
            'type' => TType::STRING,
            ),
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['skewedColNames'])) {
        $this->skewedColNames = $vals['skewedColNames'];
      }
      if (isset($vals['skewedColValues'])) {
        $this->skewedColValues = $vals['skewedColValues'];
      }
      if (isset($vals['skewedColValueLocationMaps'])) {
        $this->skewedColValueLocationMaps = $vals['skewedColValueLocationMaps'];
      }
    }
  }

  public function getName() {
    return 'SkewedInfo';
  }

  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->skewedColNames = array();
            $_size101 = 0;
            $_etype104 = 0;
            $xfer += $input->readListBegin($_etype104, $_size101);
            for ($_i105 = 0; $_i105 < $_size101; ++$_i105)
            {
              $elem106 = null;
              $xfer += $input->readString($elem106);
              $this->skewedColNames []= $elem106;
            }
            $xfer += $input->readListEnd();
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 2:
          if ($ftype == TType::LST) {
            $this->skewedColValues = array();
            $_size107 = 0;
            $_etype110 = 0;
            $xfer += $input->readListBegin($_etype110, $_size107);
            for ($_i111 = 0; $_i111 < $_size107; ++$_i111)
            {
              $elem112 = null;
              $elem112 = array();
              $_size113 = 0;
              $_etype116 = 0;
              $xfer += $input->readListBegin($_etype116, $_size113);
              for ($_i117 = 0; $_i117 < $_size113; ++$_i117)
              {
                $elem118 = null;
                $xfer += $input->readString($elem118);
                $elem112 []= $elem118;
              }
              $xfer += $input->readListEnd();
              $this->skewedColValues []= $elem112;
            }
            $xfer += $input->readListEnd();
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 3:
          if ($ftype == TType::MAP) {
            $this->skewedColValueLocationMaps = array();
            $_size119 = 0;
            $_ktype120 = 0;
            $_vtype121 = 0;
            $xfer += $input->readMapBegin($_ktype120, $_vtype121, $_size119);
            for ($_i123 = 0; $_i123 < $_size119; ++$_i123)
            {
              $key124 = array();
              $val125 = '';
              $key124 = array();
              $_size126 = 0;
              $_etype129 = 0;
              $xfer += $input->readListBegin($_etype129, $_size126);
              for ($_i130 = 0; $_i130 < $_size126; ++$_i130)
              {
                $elem131 = null;
                $xfer += $input->readString($elem131);
                $key124 []= $elem131;
              }
              $xfer += $input->readListEnd();
              $xfer += $input->readString($val125);
              $this->skewedColValueLocationMaps[$key124] = $val125;
            }
            $xfer += $input->readMapEnd();
          } 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('SkewedInfo');
    if ($this->skewedColNames !== null) {
      if (!is_array($this->skewedColNames)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('skewedColNames', TType::LST, 1);
      {
        $output->writeListBegin(TType::STRING, count($this->skewedColNames));
        {
          foreach ($this->skewedColNames as $iter132)
          {
            $xfer += $output->writeString($iter132);
          }
        }
        $output->writeListEnd();
      }
      $xfer += $output->writeFieldEnd();
    }
    if ($this->skewedColValues !== null) {
      if (!is_array($this->skewedColValues)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('skewedColValues', TType::LST, 2);
      {
        $output->writeListBegin(TType::LST, count($this->skewedColValues));
        {
          foreach ($this->skewedColValues as $iter133)
          {
            {
              $output->writeListBegin(TType::STRING, count($iter133));
              {
                foreach ($iter133 as $iter134)
                {
                  $xfer += $output->writeString($iter134);
                }
              }
              $output->writeListEnd();
            }
          }
        }
        $output->writeListEnd();
      }
      $xfer += $output->writeFieldEnd();
    }
    if ($this->skewedColValueLocationMaps !== null) {
      if (!is_array($this->skewedColValueLocationMaps)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('skewedColValueLocationMaps', TType::MAP, 3);
      {
        $output->writeMapBegin(TType::LST, TType::STRING, count($this->skewedColValueLocationMaps));
        {
          foreach ($this->skewedColValueLocationMaps as $kiter135 => $viter136)
          {
            {
              $output->writeListBegin(TType::STRING, count($kiter135));
              {
                foreach ($kiter135 as $iter137)
                {
                  $xfer += $output->writeString($iter137);
                }
              }
              $output->writeListEnd();
            }
            $xfer += $output->writeString($viter136);
          }
        }
        $output->writeMapEnd();
      }
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class StorageDescriptor {
  static $_TSPEC;

  /**
   * @var \metastore\FieldSchema[]
   */
  public $cols = null;
  /**
   * @var string
   */
  public $location = null;
  /**
   * @var string
   */
  public $inputFormat = null;
  /**
   * @var string
   */
  public $outputFormat = null;
  /**
   * @var bool
   */
  public $compressed = null;
  /**
   * @var int
   */
  public $numBuckets = null;
  /**
   * @var \metastore\SerDeInfo
   */
  public $serdeInfo = null;
  /**
   * @var string[]
   */
  public $bucketCols = null;
  /**
   * @var \metastore\Order[]
   */
  public $sortCols = null;
  /**
   * @var array
   */
  public $parameters = null;
  /**
   * @var \metastore\SkewedInfo
   */
  public $skewedInfo = null;
  /**
   * @var bool
   */
  public $storedAsSubDirectories = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'cols',
          'type' => TType::LST,
          'etype' => TType::STRUCT,
          'elem' => array(
            'type' => TType::STRUCT,
            'class' => '\metastore\FieldSchema',
            ),
          ),
        2 => array(
          'var' => 'location',
          'type' => TType::STRING,
          ),
        3 => array(
          'var' => 'inputFormat',
          'type' => TType::STRING,
          ),
        4 => array(
          'var' => 'outputFormat',
          'type' => TType::STRING,
          ),
        5 => array(
          'var' => 'compressed',
          'type' => TType::BOOL,
          ),
        6 => array(
          'var' => 'numBuckets',
          'type' => TType::I32,
          ),
        7 => array(
          'var' => 'serdeInfo',
          'type' => TType::STRUCT,
          'class' => '\metastore\SerDeInfo',
          ),
        8 => array(
          'var' => 'bucketCols',
          'type' => TType::LST,
          'etype' => TType::STRING,
          'elem' => array(
            'type' => TType::STRING,
            ),
          ),
        9 => array(
          'var' => 'sortCols',
          'type' => TType::LST,
          'etype' => TType::STRUCT,
          'elem' => array(
            'type' => TType::STRUCT,
            'class' => '\metastore\Order',
            ),
          ),
        10 => array(
          'var' => 'parameters',
          'type' => TType::MAP,
          'ktype' => TType::STRING,
          'vtype' => TType::STRING,
          'key' => array(
            'type' => TType::STRING,
          ),
          'val' => array(
            'type' => TType::STRING,
            ),
          ),
        11 => array(
          'var' => 'skewedInfo',
          'type' => TType::STRUCT,
          'class' => '\metastore\SkewedInfo',
          ),
        12 => array(
          'var' => 'storedAsSubDirectories',
          'type' => TType::BOOL,
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['cols'])) {
        $this->cols = $vals['cols'];
      }
      if (isset($vals['location'])) {
        $this->location = $vals['location'];
      }
      if (isset($vals['inputFormat'])) {
        $this->inputFormat = $vals['inputFormat'];
      }
      if (isset($vals['outputFormat'])) {
        $this->outputFormat = $vals['outputFormat'];
      }
      if (isset($vals['compressed'])) {
        $this->compressed = $vals['compressed'];
      }
      if (isset($vals['numBuckets'])) {
        $this->numBuckets = $vals['numBuckets'];
      }
      if (isset($vals['serdeInfo'])) {
        $this->serdeInfo = $vals['serdeInfo'];
      }
      if (isset($vals['bucketCols'])) {
        $this->bucketCols = $vals['bucketCols'];
      }
      if (isset($vals['sortCols'])) {
        $this->sortCols = $vals['sortCols'];
      }
      if (isset($vals['parameters'])) {
        $this->parameters = $vals['parameters'];
      }
      if (isset($vals['skewedInfo'])) {
        $this->skewedInfo = $vals['skewedInfo'];
      }
      if (isset($vals['storedAsSubDirectories'])) {
        $this->storedAsSubDirectories = $vals['storedAsSubDirectories'];
      }
    }
  }

  public function getName() {
    return 'StorageDescriptor';
  }

  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->cols = array();
            $_size138 = 0;
            $_etype141 = 0;
            $xfer += $input->readListBegin($_etype141, $_size138);
            for ($_i142 = 0; $_i142 < $_size138; ++$_i142)
            {
              $elem143 = null;
              $elem143 = new \metastore\FieldSchema();
              $xfer += $elem143->read($input);
              $this->cols []= $elem143;
            }
            $xfer += $input->readListEnd();
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 2:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->location);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 3:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->inputFormat);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 4:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->outputFormat);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 5:
          if ($ftype == TType::BOOL) {
            $xfer += $input->readBool($this->compressed);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 6:
          if ($ftype == TType::I32) {
            $xfer += $input->readI32($this->numBuckets);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 7:
          if ($ftype == TType::STRUCT) {
            $this->serdeInfo = new \metastore\SerDeInfo();
            $xfer += $this->serdeInfo->read($input);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 8:
          if ($ftype == TType::LST) {
            $this->bucketCols = array();
            $_size144 = 0;
            $_etype147 = 0;
            $xfer += $input->readListBegin($_etype147, $_size144);
            for ($_i148 = 0; $_i148 < $_size144; ++$_i148)
            {
              $elem149 = null;
              $xfer += $input->readString($elem149);
              $this->bucketCols []= $elem149;
            }
            $xfer += $input->readListEnd();
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 9:
          if ($ftype == TType::LST) {
            $this->sortCols = array();
            $_size150 = 0;
            $_etype153 = 0;
            $xfer += $input->readListBegin($_etype153, $_size150);
            for ($_i154 = 0; $_i154 < $_size150; ++$_i154)
            {
              $elem155 = null;
              $elem155 = new \metastore\Order();
              $xfer += $elem155->read($input);
              $this->sortCols []= $elem155;
            }
            $xfer += $input->readListEnd();
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 10:
          if ($ftype == TType::MAP) {
            $this->parameters = array();
            $_size156 = 0;
            $_ktype157 = 0;
            $_vtype158 = 0;
            $xfer += $input->readMapBegin($_ktype157, $_vtype158, $_size156);
            for ($_i160 = 0; $_i160 < $_size156; ++$_i160)
            {
              $key161 = '';
              $val162 = '';
              $xfer += $input->readString($key161);
              $xfer += $input->readString($val162);
              $this->parameters[$key161] = $val162;
            }
            $xfer += $input->readMapEnd();
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 11:
          if ($ftype == TType::STRUCT) {
            $this->skewedInfo = new \metastore\SkewedInfo();
            $xfer += $this->skewedInfo->read($input);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 12:
          if ($ftype == TType::BOOL) {
            $xfer += $input->readBool($this->storedAsSubDirectories);
          } 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('StorageDescriptor');
    if ($this->cols !== null) {
      if (!is_array($this->cols)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('cols', TType::LST, 1);
      {
        $output->writeListBegin(TType::STRUCT, count($this->cols));
        {
          foreach ($this->cols as $iter163)
          {
            $xfer += $iter163->write($output);
          }
        }
        $output->writeListEnd();
      }
      $xfer += $output->writeFieldEnd();
    }
    if ($this->location !== null) {
      $xfer += $output->writeFieldBegin('location', TType::STRING, 2);
      $xfer += $output->writeString($this->location);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->inputFormat !== null) {
      $xfer += $output->writeFieldBegin('inputFormat', TType::STRING, 3);
      $xfer += $output->writeString($this->inputFormat);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->outputFormat !== null) {
      $xfer += $output->writeFieldBegin('outputFormat', TType::STRING, 4);
      $xfer += $output->writeString($this->outputFormat);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->compressed !== null) {
      $xfer += $output->writeFieldBegin('compressed', TType::BOOL, 5);
      $xfer += $output->writeBool($this->compressed);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->numBuckets !== null) {
      $xfer += $output->writeFieldBegin('numBuckets', TType::I32, 6);
      $xfer += $output->writeI32($this->numBuckets);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->serdeInfo !== null) {
      if (!is_object($this->serdeInfo)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('serdeInfo', TType::STRUCT, 7);
      $xfer += $this->serdeInfo->write($output);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->bucketCols !== null) {
      if (!is_array($this->bucketCols)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('bucketCols', TType::LST, 8);
      {
        $output->writeListBegin(TType::STRING, count($this->bucketCols));
        {
          foreach ($this->bucketCols as $iter164)
          {
            $xfer += $output->writeString($iter164);
          }
        }
        $output->writeListEnd();
      }
      $xfer += $output->writeFieldEnd();
    }
    if ($this->sortCols !== null) {
      if (!is_array($this->sortCols)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('sortCols', TType::LST, 9);
      {
        $output->writeListBegin(TType::STRUCT, count($this->sortCols));
        {
          foreach ($this->sortCols as $iter165)
          {
            $xfer += $iter165->write($output);
          }
        }
        $output->writeListEnd();
      }
      $xfer += $output->writeFieldEnd();
    }
    if ($this->parameters !== null) {
      if (!is_array($this->parameters)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('parameters', TType::MAP, 10);
      {
        $output->writeMapBegin(TType::STRING, TType::STRING, count($this->parameters));
        {
          foreach ($this->parameters as $kiter166 => $viter167)
          {
            $xfer += $output->writeString($kiter166);
            $xfer += $output->writeString($viter167);
          }
        }
        $output->writeMapEnd();
      }
      $xfer += $output->writeFieldEnd();
    }
    if ($this->skewedInfo !== null) {
      if (!is_object($this->skewedInfo)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('skewedInfo', TType::STRUCT, 11);
      $xfer += $this->skewedInfo->write($output);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->storedAsSubDirectories !== null) {
      $xfer += $output->writeFieldBegin('storedAsSubDirectories', TType::BOOL, 12);
      $xfer += $output->writeBool($this->storedAsSubDirectories);
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class Table {
  static $_TSPEC;

  /**
   * @var string
   */
  public $tableName = null;
  /**
   * @var string
   */
  public $dbName = null;
  /**
   * @var string
   */
  public $owner = null;
  /**
   * @var int
   */
  public $createTime = null;
  /**
   * @var int
   */
  public $lastAccessTime = null;
  /**
   * @var int
   */
  public $retention = null;
  /**
   * @var \metastore\StorageDescriptor
   */
  public $sd = null;
  /**
   * @var \metastore\FieldSchema[]
   */
  public $partitionKeys = null;
  /**
   * @var array
   */
  public $parameters = null;
  /**
   * @var string
   */
  public $viewOriginalText = null;
  /**
   * @var string
   */
  public $viewExpandedText = null;
  /**
   * @var string
   */
  public $tableType = null;
  /**
   * @var \metastore\PrincipalPrivilegeSet
   */
  public $privileges = null;
  /**
   * @var bool
   */
  public $temporary = false;
  /**
   * @var bool
   */
  public $rewriteEnabled = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'tableName',
          'type' => TType::STRING,
          ),
        2 => array(
          'var' => 'dbName',
          'type' => TType::STRING,
          ),
        3 => array(
          'var' => 'owner',
          'type' => TType::STRING,
          ),
        4 => array(
          'var' => 'createTime',
          'type' => TType::I32,
          ),
        5 => array(
          'var' => 'lastAccessTime',
          'type' => TType::I32,
          ),
        6 => array(
          'var' => 'retention',
          'type' => TType::I32,
          ),
        7 => array(
          'var' => 'sd',
          'type' => TType::STRUCT,
          'class' => '\metastore\StorageDescriptor',
          ),
        8 => array(
          'var' => 'partitionKeys',
          'type' => TType::LST,
          'etype' => TType::STRUCT,
          'elem' => array(
            'type' => TType::STRUCT,
            'class' => '\metastore\FieldSchema',
            ),
          ),
        9 => array(
          'var' => 'parameters',
          'type' => TType::MAP,
          'ktype' => TType::STRING,
          'vtype' => TType::STRING,
          'key' => array(
            'type' => TType::STRING,
          ),
          'val' => array(
            'type' => TType::STRING,
            ),
          ),
        10 => array(
          'var' => 'viewOriginalText',
          'type' => TType::STRING,
          ),
        11 => array(
          'var' => 'viewExpandedText',
          'type' => TType::STRING,
          ),
        12 => array(
          'var' => 'tableType',
          'type' => TType::STRING,
          ),
        13 => array(
          'var' => 'privileges',
          'type' => TType::STRUCT,
          'class' => '\metastore\PrincipalPrivilegeSet',
          ),
        14 => array(
          'var' => 'temporary',
          'type' => TType::BOOL,
          ),
        15 => array(
          'var' => 'rewriteEnabled',
          'type' => TType::BOOL,
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['tableName'])) {
        $this->tableName = $vals['tableName'];
      }
      if (isset($vals['dbName'])) {
        $this->dbName = $vals['dbName'];
      }
      if (isset($vals['owner'])) {
        $this->owner = $vals['owner'];
      }
      if (isset($vals['createTime'])) {
        $this->createTime = $vals['createTime'];
      }
      if (isset($vals['lastAccessTime'])) {
        $this->lastAccessTime = $vals['lastAccessTime'];
      }
      if (isset($vals['retention'])) {
        $this->retention = $vals['retention'];
      }
      if (isset($vals['sd'])) {
        $this->sd = $vals['sd'];
      }
      if (isset($vals['partitionKeys'])) {
        $this->partitionKeys = $vals['partitionKeys'];
      }
      if (isset($vals['parameters'])) {
        $this->parameters = $vals['parameters'];
      }
      if (isset($vals['viewOriginalText'])) {
        $this->viewOriginalText = $vals['viewOriginalText'];
      }
      if (isset($vals['viewExpandedText'])) {
        $this->viewExpandedText = $vals['viewExpandedText'];
      }
      if (isset($vals['tableType'])) {
        $this->tableType = $vals['tableType'];
      }
      if (isset($vals['privileges'])) {
        $this->privileges = $vals['privileges'];
      }
      if (isset($vals['temporary'])) {
        $this->temporary = $vals['temporary'];
      }
      if (isset($vals['rewriteEnabled'])) {
        $this->rewriteEnabled = $vals['rewriteEnabled'];
      }
    }
  }

  public function getName() {
    return 'Table';
  }

  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->tableName);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 2:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->dbName);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 3:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->owner);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 4:
          if ($ftype == TType::I32) {
            $xfer += $input->readI32($this->createTime);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 5:
          if ($ftype == TType::I32) {
            $xfer += $input->readI32($this->lastAccessTime);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 6:
          if ($ftype == TType::I32) {
            $xfer += $input->readI32($this->retention);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 7:
          if ($ftype == TType::STRUCT) {
            $this->sd = new \metastore\StorageDescriptor();
            $xfer += $this->sd->read($input);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 8:
          if ($ftype == TType::LST) {
            $this->partitionKeys = array();
            $_size168 = 0;
            $_etype171 = 0;
            $xfer += $input->readListBegin($_etype171, $_size168);
            for ($_i172 = 0; $_i172 < $_size168; ++$_i172)
            {
              $elem173 = null;
              $elem173 = new \metastore\FieldSchema();
              $xfer += $elem173->read($input);
              $this->partitionKeys []= $elem173;
            }
            $xfer += $input->readListEnd();
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 9:
          if ($ftype == TType::MAP) {
            $this->parameters = array();
            $_size174 = 0;
            $_ktype175 = 0;
            $_vtype176 = 0;
            $xfer += $input->readMapBegin($_ktype175, $_vtype176, $_size174);
            for ($_i178 = 0; $_i178 < $_size174; ++$_i178)
            {
              $key179 = '';
              $val180 = '';
              $xfer += $input->readString($key179);
              $xfer += $input->readString($val180);
              $this->parameters[$key179] = $val180;
            }
            $xfer += $input->readMapEnd();
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 10:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->viewOriginalText);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 11:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->viewExpandedText);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 12:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->tableType);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 13:
          if ($ftype == TType::STRUCT) {
            $this->privileges = new \metastore\PrincipalPrivilegeSet();
            $xfer += $this->privileges->read($input);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 14:
          if ($ftype == TType::BOOL) {
            $xfer += $input->readBool($this->temporary);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 15:
          if ($ftype == TType::BOOL) {
            $xfer += $input->readBool($this->rewriteEnabled);
          } 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('Table');
    if ($this->tableName !== null) {
      $xfer += $output->writeFieldBegin('tableName', TType::STRING, 1);
      $xfer += $output->writeString($this->tableName);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->dbName !== null) {
      $xfer += $output->writeFieldBegin('dbName', TType::STRING, 2);
      $xfer += $output->writeString($this->dbName);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->owner !== null) {
      $xfer += $output->writeFieldBegin('owner', TType::STRING, 3);
      $xfer += $output->writeString($this->owner);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->createTime !== null) {
      $xfer += $output->writeFieldBegin('createTime', TType::I32, 4);
      $xfer += $output->writeI32($this->createTime);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->lastAccessTime !== null) {
      $xfer += $output->writeFieldBegin('lastAccessTime', TType::I32, 5);
      $xfer += $output->writeI32($this->lastAccessTime);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->retention !== null) {
      $xfer += $output->writeFieldBegin('retention', TType::I32, 6);
      $xfer += $output->writeI32($this->retention);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->sd !== null) {
      if (!is_object($this->sd)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('sd', TType::STRUCT, 7);
      $xfer += $this->sd->write($output);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->partitionKeys !== null) {
      if (!is_array($this->partitionKeys)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('partitionKeys', TType::LST, 8);
      {
        $output->writeListBegin(TType::STRUCT, count($this->partitionKeys));
        {
          foreach ($this->partitionKeys as $iter181)
          {
            $xfer += $iter181->write($output);
          }
        }
        $output->writeListEnd();
      }
      $xfer += $output->writeFieldEnd();
    }
    if ($this->parameters !== null) {
      if (!is_array($this->parameters)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('parameters', TType::MAP, 9);
      {
        $output->writeMapBegin(TType::STRING, TType::STRING, count($this->parameters));
        {
          foreach ($this->parameters as $kiter182 => $viter183)
          {
            $xfer += $output->writeString($kiter182);
            $xfer += $output->writeString($viter183);
          }
        }
        $output->writeMapEnd();
      }
      $xfer += $output->writeFieldEnd();
    }
    if ($this->viewOriginalText !== null) {
      $xfer += $output->writeFieldBegin('viewOriginalText', TType::STRING, 10);
      $xfer += $output->writeString($this->viewOriginalText);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->viewExpandedText !== null) {
      $xfer += $output->writeFieldBegin('viewExpandedText', TType::STRING, 11);
      $xfer += $output->writeString($this->viewExpandedText);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->tableType !== null) {
      $xfer += $output->writeFieldBegin('tableType', TType::STRING, 12);
      $xfer += $output->writeString($this->tableType);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->privileges !== null) {
      if (!is_object($this->privileges)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('privileges', TType::STRUCT, 13);
      $xfer += $this->privileges->write($output);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->temporary !== null) {
      $xfer += $output->writeFieldBegin('temporary', TType::BOOL, 14);
      $xfer += $output->writeBool($this->temporary);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->rewriteEnabled !== null) {
      $xfer += $output->writeFieldBegin('rewriteEnabled', TType::BOOL, 15);
      $xfer += $output->writeBool($this->rewriteEnabled);
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class Partition {
  static $_TSPEC;

  /**
   * @var string[]
   */
  public $values = null;
  /**
   * @var string
   */
  public $dbName = null;
  /**
   * @var string
   */
  public $tableName = null;
  /**
   * @var int
   */
  public $createTime = null;
  /**
   * @var int
   */
  public $lastAccessTime = null;
  /**
   * @var \metastore\StorageDescriptor
   */
  public $sd = null;
  /**
   * @var array
   */
  public $parameters = null;
  /**
   * @var \metastore\PrincipalPrivilegeSet
   */
  public $privileges = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'values',
          'type' => TType::LST,
          'etype' => TType::STRING,
          'elem' => array(
            'type' => TType::STRING,
            ),
          ),
        2 => array(
          'var' => 'dbName',
          'type' => TType::STRING,
          ),
        3 => array(
          'var' => 'tableName',
          'type' => TType::STRING,
          ),
        4 => array(
          'var' => 'createTime',
          'type' => TType::I32,
          ),
        5 => array(
          'var' => 'lastAccessTime',
          'type' => TType::I32,
          ),
        6 => array(
          'var' => 'sd',
          'type' => TType::STRUCT,
          'class' => '\metastore\StorageDescriptor',
          ),
        7 => array(
          'var' => 'parameters',
          'type' => TType::MAP,
          'ktype' => TType::STRING,
          'vtype' => TType::STRING,
          'key' => array(
            'type' => TType::STRING,
          ),
          'val' => array(
            'type' => TType::STRING,
            ),
          ),
        8 => array(
          'var' => 'privileges',
          'type' => TType::STRUCT,
          'class' => '\metastore\PrincipalPrivilegeSet',
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['values'])) {
        $this->values = $vals['values'];
      }
      if (isset($vals['dbName'])) {
        $this->dbName = $vals['dbName'];
      }
      if (isset($vals['tableName'])) {
        $this->tableName = $vals['tableName'];
      }
      if (isset($vals['createTime'])) {
        $this->createTime = $vals['createTime'];
      }
      if (isset($vals['lastAccessTime'])) {
        $this->lastAccessTime = $vals['lastAccessTime'];
      }
      if (isset($vals['sd'])) {
        $this->sd = $vals['sd'];
      }
      if (isset($vals['parameters'])) {
        $this->parameters = $vals['parameters'];
      }
      if (isset($vals['privileges'])) {
        $this->privileges = $vals['privileges'];
      }
    }
  }

  public function getName() {
    return 'Partition';
  }

  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->values = array();
            $_size184 = 0;
            $_etype187 = 0;
            $xfer += $input->readListBegin($_etype187, $_size184);
            for ($_i188 = 0; $_i188 < $_size184; ++$_i188)
            {
              $elem189 = null;
              $xfer += $input->readString($elem189);
              $this->values []= $elem189;
            }
            $xfer += $input->readListEnd();
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 2:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->dbName);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 3:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->tableName);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 4:
          if ($ftype == TType::I32) {
            $xfer += $input->readI32($this->createTime);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 5:
          if ($ftype == TType::I32) {
            $xfer += $input->readI32($this->lastAccessTime);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 6:
          if ($ftype == TType::STRUCT) {
            $this->sd = new \metastore\StorageDescriptor();
            $xfer += $this->sd->read($input);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 7:
          if ($ftype == TType::MAP) {
            $this->parameters = array();
            $_size190 = 0;
            $_ktype191 = 0;
            $_vtype192 = 0;
            $xfer += $input->readMapBegin($_ktype191, $_vtype192, $_size190);
            for ($_i194 = 0; $_i194 < $_size190; ++$_i194)
            {
              $key195 = '';
              $val196 = '';
              $xfer += $input->readString($key195);
              $xfer += $input->readString($val196);
              $this->parameters[$key195] = $val196;
            }
            $xfer += $input->readMapEnd();
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 8:
          if ($ftype == TType::STRUCT) {
            $this->privileges = new \metastore\PrincipalPrivilegeSet();
            $xfer += $this->privileges->read($input);
          } 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('Partition');
    if ($this->values !== null) {
      if (!is_array($this->values)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('values', TType::LST, 1);
      {
        $output->writeListBegin(TType::STRING, count($this->values));
        {
          foreach ($this->values as $iter197)
          {
            $xfer += $output->writeString($iter197);
          }
        }
        $output->writeListEnd();
      }
      $xfer += $output->writeFieldEnd();
    }
    if ($this->dbName !== null) {
      $xfer += $output->writeFieldBegin('dbName', TType::STRING, 2);
      $xfer += $output->writeString($this->dbName);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->tableName !== null) {
      $xfer += $output->writeFieldBegin('tableName', TType::STRING, 3);
      $xfer += $output->writeString($this->tableName);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->createTime !== null) {
      $xfer += $output->writeFieldBegin('createTime', TType::I32, 4);
      $xfer += $output->writeI32($this->createTime);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->lastAccessTime !== null) {
      $xfer += $output->writeFieldBegin('lastAccessTime', TType::I32, 5);
      $xfer += $output->writeI32($this->lastAccessTime);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->sd !== null) {
      if (!is_object($this->sd)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('sd', TType::STRUCT, 6);
      $xfer += $this->sd->write($output);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->parameters !== null) {
      if (!is_array($this->parameters)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('parameters', TType::MAP, 7);
      {
        $output->writeMapBegin(TType::STRING, TType::STRING, count($this->parameters));
        {
          foreach ($this->parameters as $kiter198 => $viter199)
          {
            $xfer += $output->writeString($kiter198);
            $xfer += $output->writeString($viter199);
          }
        }
        $output->writeMapEnd();
      }
      $xfer += $output->writeFieldEnd();
    }
    if ($this->privileges !== null) {
      if (!is_object($this->privileges)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('privileges', TType::STRUCT, 8);
      $xfer += $this->privileges->write($output);
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class PartitionWithoutSD {
  static $_TSPEC;

  /**
   * @var string[]
   */
  public $values = null;
  /**
   * @var int
   */
  public $createTime = null;
  /**
   * @var int
   */
  public $lastAccessTime = null;
  /**
   * @var string
   */
  public $relativePath = null;
  /**
   * @var array
   */
  public $parameters = null;
  /**
   * @var \metastore\PrincipalPrivilegeSet
   */
  public $privileges = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'values',
          'type' => TType::LST,
          'etype' => TType::STRING,
          'elem' => array(
            'type' => TType::STRING,
            ),
          ),
        2 => array(
          'var' => 'createTime',
          'type' => TType::I32,
          ),
        3 => array(
          'var' => 'lastAccessTime',
          'type' => TType::I32,
          ),
        4 => array(
          'var' => 'relativePath',
          'type' => TType::STRING,
          ),
        5 => array(
          'var' => 'parameters',
          'type' => TType::MAP,
          'ktype' => TType::STRING,
          'vtype' => TType::STRING,
          'key' => array(
            'type' => TType::STRING,
          ),
          'val' => array(
            'type' => TType::STRING,
            ),
          ),
        6 => array(
          'var' => 'privileges',
          'type' => TType::STRUCT,
          'class' => '\metastore\PrincipalPrivilegeSet',
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['values'])) {
        $this->values = $vals['values'];
      }
      if (isset($vals['createTime'])) {
        $this->createTime = $vals['createTime'];
      }
      if (isset($vals['lastAccessTime'])) {
        $this->lastAccessTime = $vals['lastAccessTime'];
      }
      if (isset($vals['relativePath'])) {
        $this->relativePath = $vals['relativePath'];
      }
      if (isset($vals['parameters'])) {
        $this->parameters = $vals['parameters'];
      }
      if (isset($vals['privileges'])) {
        $this->privileges = $vals['privileges'];
      }
    }
  }

  public function getName() {
    return 'PartitionWithoutSD';
  }

  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->values = array();
            $_size200 = 0;
            $_etype203 = 0;
            $xfer += $input->readListBegin($_etype203, $_size200);
            for ($_i204 = 0; $_i204 < $_size200; ++$_i204)
            {
              $elem205 = null;
              $xfer += $input->readString($elem205);
              $this->values []= $elem205;
            }
            $xfer += $input->readListEnd();
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 2:
          if ($ftype == TType::I32) {
            $xfer += $input->readI32($this->createTime);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 3:
          if ($ftype == TType::I32) {
            $xfer += $input->readI32($this->lastAccessTime);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 4:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->relativePath);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 5:
          if ($ftype == TType::MAP) {
            $this->parameters = array();
            $_size206 = 0;
            $_ktype207 = 0;
            $_vtype208 = 0;
            $xfer += $input->readMapBegin($_ktype207, $_vtype208, $_size206);
            for ($_i210 = 0; $_i210 < $_size206; ++$_i210)
            {
              $key211 = '';
              $val212 = '';
              $xfer += $input->readString($key211);
              $xfer += $input->readString($val212);
              $this->parameters[$key211] = $val212;
            }
            $xfer += $input->readMapEnd();
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 6:
          if ($ftype == TType::STRUCT) {
            $this->privileges = new \metastore\PrincipalPrivilegeSet();
            $xfer += $this->privileges->read($input);
          } 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('PartitionWithoutSD');
    if ($this->values !== null) {
      if (!is_array($this->values)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('values', TType::LST, 1);
      {
        $output->writeListBegin(TType::STRING, count($this->values));
        {
          foreach ($this->values as $iter213)
          {
            $xfer += $output->writeString($iter213);
          }
        }
        $output->writeListEnd();
      }
      $xfer += $output->writeFieldEnd();
    }
    if ($this->createTime !== null) {
      $xfer += $output->writeFieldBegin('createTime', TType::I32, 2);
      $xfer += $output->writeI32($this->createTime);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->lastAccessTime !== null) {
      $xfer += $output->writeFieldBegin('lastAccessTime', TType::I32, 3);
      $xfer += $output->writeI32($this->lastAccessTime);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->relativePath !== null) {
      $xfer += $output->writeFieldBegin('relativePath', TType::STRING, 4);
      $xfer += $output->writeString($this->relativePath);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->parameters !== null) {
      if (!is_array($this->parameters)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('parameters', TType::MAP, 5);
      {
        $output->writeMapBegin(TType::STRING, TType::STRING, count($this->parameters));
        {
          foreach ($this->parameters as $kiter214 => $viter215)
          {
            $xfer += $output->writeString($kiter214);
            $xfer += $output->writeString($viter215);
          }
        }
        $output->writeMapEnd();
      }
      $xfer += $output->writeFieldEnd();
    }
    if ($this->privileges !== null) {
      if (!is_object($this->privileges)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('privileges', TType::STRUCT, 6);
      $xfer += $this->privileges->write($output);
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class PartitionSpecWithSharedSD {
  static $_TSPEC;

  /**
   * @var \metastore\PartitionWithoutSD[]
   */
  public $partitions = null;
  /**
   * @var \metastore\StorageDescriptor
   */
  public $sd = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'partitions',
          'type' => TType::LST,
          'etype' => TType::STRUCT,
          'elem' => array(
            'type' => TType::STRUCT,
            'class' => '\metastore\PartitionWithoutSD',
            ),
          ),
        2 => array(
          'var' => 'sd',
          'type' => TType::STRUCT,
          'class' => '\metastore\StorageDescriptor',
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['partitions'])) {
        $this->partitions = $vals['partitions'];
      }
      if (isset($vals['sd'])) {
        $this->sd = $vals['sd'];
      }
    }
  }

  public function getName() {
    return 'PartitionSpecWithSharedSD';
  }

  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->partitions = array();
            $_size216 = 0;
            $_etype219 = 0;
            $xfer += $input->readListBegin($_etype219, $_size216);
            for ($_i220 = 0; $_i220 < $_size216; ++$_i220)
            {
              $elem221 = null;
              $elem221 = new \metastore\PartitionWithoutSD();
              $xfer += $elem221->read($input);
              $this->partitions []= $elem221;
            }
            $xfer += $input->readListEnd();
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 2:
          if ($ftype == TType::STRUCT) {
            $this->sd = new \metastore\StorageDescriptor();
            $xfer += $this->sd->read($input);
          } 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('PartitionSpecWithSharedSD');
    if ($this->partitions !== null) {
      if (!is_array($this->partitions)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('partitions', TType::LST, 1);
      {
        $output->writeListBegin(TType::STRUCT, count($this->partitions));
        {
          foreach ($this->partitions as $iter222)
          {
            $xfer += $iter222->write($output);
          }
        }
        $output->writeListEnd();
      }
      $xfer += $output->writeFieldEnd();
    }
    if ($this->sd !== null) {
      if (!is_object($this->sd)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('sd', TType::STRUCT, 2);
      $xfer += $this->sd->write($output);
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class PartitionListComposingSpec {
  static $_TSPEC;

  /**
   * @var \metastore\Partition[]
   */
  public $partitions = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'partitions',
          'type' => TType::LST,
          'etype' => TType::STRUCT,
          'elem' => array(
            'type' => TType::STRUCT,
            'class' => '\metastore\Partition',
            ),
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['partitions'])) {
        $this->partitions = $vals['partitions'];
      }
    }
  }

  public function getName() {
    return 'PartitionListComposingSpec';
  }

  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->partitions = array();
            $_size223 = 0;
            $_etype226 = 0;
            $xfer += $input->readListBegin($_etype226, $_size223);
            for ($_i227 = 0; $_i227 < $_size223; ++$_i227)
            {
              $elem228 = null;
              $elem228 = new \metastore\Partition();
              $xfer += $elem228->read($input);
              $this->partitions []= $elem228;
            }
            $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('PartitionListComposingSpec');
    if ($this->partitions !== null) {
      if (!is_array($this->partitions)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('partitions', TType::LST, 1);
      {
        $output->writeListBegin(TType::STRUCT, count($this->partitions));
        {
          foreach ($this->partitions as $iter229)
          {
            $xfer += $iter229->write($output);
          }
        }
        $output->writeListEnd();
      }
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class PartitionSpec {
  static $_TSPEC;

  /**
   * @var string
   */
  public $dbName = null;
  /**
   * @var string
   */
  public $tableName = null;
  /**
   * @var string
   */
  public $rootPath = null;
  /**
   * @var \metastore\PartitionSpecWithSharedSD
   */
  public $sharedSDPartitionSpec = null;
  /**
   * @var \metastore\PartitionListComposingSpec
   */
  public $partitionList = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'dbName',
          'type' => TType::STRING,
          ),
        2 => array(
          'var' => 'tableName',
          'type' => TType::STRING,
          ),
        3 => array(
          'var' => 'rootPath',
          'type' => TType::STRING,
          ),
        4 => array(
          'var' => 'sharedSDPartitionSpec',
          'type' => TType::STRUCT,
          'class' => '\metastore\PartitionSpecWithSharedSD',
          ),
        5 => array(
          'var' => 'partitionList',
          'type' => TType::STRUCT,
          'class' => '\metastore\PartitionListComposingSpec',
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['dbName'])) {
        $this->dbName = $vals['dbName'];
      }
      if (isset($vals['tableName'])) {
        $this->tableName = $vals['tableName'];
      }
      if (isset($vals['rootPath'])) {
        $this->rootPath = $vals['rootPath'];
      }
      if (isset($vals['sharedSDPartitionSpec'])) {
        $this->sharedSDPartitionSpec = $vals['sharedSDPartitionSpec'];
      }
      if (isset($vals['partitionList'])) {
        $this->partitionList = $vals['partitionList'];
      }
    }
  }

  public function getName() {
    return 'PartitionSpec';
  }

  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->dbName);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 2:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->tableName);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 3:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->rootPath);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 4:
          if ($ftype == TType::STRUCT) {
            $this->sharedSDPartitionSpec = new \metastore\PartitionSpecWithSharedSD();
            $xfer += $this->sharedSDPartitionSpec->read($input);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 5:
          if ($ftype == TType::STRUCT) {
            $this->partitionList = new \metastore\PartitionListComposingSpec();
            $xfer += $this->partitionList->read($input);
          } 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('PartitionSpec');
    if ($this->dbName !== null) {
      $xfer += $output->writeFieldBegin('dbName', TType::STRING, 1);
      $xfer += $output->writeString($this->dbName);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->tableName !== null) {
      $xfer += $output->writeFieldBegin('tableName', TType::STRING, 2);
      $xfer += $output->writeString($this->tableName);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->rootPath !== null) {
      $xfer += $output->writeFieldBegin('rootPath', TType::STRING, 3);
      $xfer += $output->writeString($this->rootPath);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->sharedSDPartitionSpec !== null) {
      if (!is_object($this->sharedSDPartitionSpec)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('sharedSDPartitionSpec', TType::STRUCT, 4);
      $xfer += $this->sharedSDPartitionSpec->write($output);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->partitionList !== null) {
      if (!is_object($this->partitionList)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('partitionList', TType::STRUCT, 5);
      $xfer += $this->partitionList->write($output);
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class Index {
  static $_TSPEC;

  /**
   * @var string
   */
  public $indexName = null;
  /**
   * @var string
   */
  public $indexHandlerClass = null;
  /**
   * @var string
   */
  public $dbName = null;
  /**
   * @var string
   */
  public $origTableName = null;
  /**
   * @var int
   */
  public $createTime = null;
  /**
   * @var int
   */
  public $lastAccessTime = null;
  /**
   * @var string
   */
  public $indexTableName = null;
  /**
   * @var \metastore\StorageDescriptor
   */
  public $sd = null;
  /**
   * @var array
   */
  public $parameters = null;
  /**
   * @var bool
   */
  public $deferredRebuild = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'indexName',
          'type' => TType::STRING,
          ),
        2 => array(
          'var' => 'indexHandlerClass',
          'type' => TType::STRING,
          ),
        3 => array(
          'var' => 'dbName',
          'type' => TType::STRING,
          ),
        4 => array(
          'var' => 'origTableName',
          'type' => TType::STRING,
          ),
        5 => array(
          'var' => 'createTime',
          'type' => TType::I32,
          ),
        6 => array(
          'var' => 'lastAccessTime',
          'type' => TType::I32,
          ),
        7 => array(
          'var' => 'indexTableName',
          'type' => TType::STRING,
          ),
        8 => array(
          'var' => 'sd',
          'type' => TType::STRUCT,
          'class' => '\metastore\StorageDescriptor',
          ),
        9 => array(
          'var' => 'parameters',
          'type' => TType::MAP,
          'ktype' => TType::STRING,
          'vtype' => TType::STRING,
          'key' => array(
            'type' => TType::STRING,
          ),
          'val' => array(
            'type' => TType::STRING,
            ),
          ),
        10 => array(
          'var' => 'deferredRebuild',
          'type' => TType::BOOL,
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['indexName'])) {
        $this->indexName = $vals['indexName'];
      }
      if (isset($vals['indexHandlerClass'])) {
        $this->indexHandlerClass = $vals['indexHandlerClass'];
      }
      if (isset($vals['dbName'])) {
        $this->dbName = $vals['dbName'];
      }
      if (isset($vals['origTableName'])) {
        $this->origTableName = $vals['origTableName'];
      }
      if (isset($vals['createTime'])) {
        $this->createTime = $vals['createTime'];
      }
      if (isset($vals['lastAccessTime'])) {
        $this->lastAccessTime = $vals['lastAccessTime'];
      }
      if (isset($vals['indexTableName'])) {
        $this->indexTableName = $vals['indexTableName'];
      }
      if (isset($vals['sd'])) {
        $this->sd = $vals['sd'];
      }
      if (isset($vals['parameters'])) {
        $this->parameters = $vals['parameters'];
      }
      if (isset($vals['deferredRebuild'])) {
        $this->deferredRebuild = $vals['deferredRebuild'];
      }
    }
  }

  public function getName() {
    return 'Index';
  }

  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->indexName);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 2:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->indexHandlerClass);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 3:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->dbName);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 4:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->origTableName);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 5:
          if ($ftype == TType::I32) {
            $xfer += $input->readI32($this->createTime);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 6:
          if ($ftype == TType::I32) {
            $xfer += $input->readI32($this->lastAccessTime);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 7:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->indexTableName);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 8:
          if ($ftype == TType::STRUCT) {
            $this->sd = new \metastore\StorageDescriptor();
            $xfer += $this->sd->read($input);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 9:
          if ($ftype == TType::MAP) {
            $this->parameters = array();
            $_size230 = 0;
            $_ktype231 = 0;
            $_vtype232 = 0;
            $xfer += $input->readMapBegin($_ktype231, $_vtype232, $_size230);
            for ($_i234 = 0; $_i234 < $_size230; ++$_i234)
            {
              $key235 = '';
              $val236 = '';
              $xfer += $input->readString($key235);
              $xfer += $input->readString($val236);
              $this->parameters[$key235] = $val236;
            }
            $xfer += $input->readMapEnd();
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 10:
          if ($ftype == TType::BOOL) {
            $xfer += $input->readBool($this->deferredRebuild);
          } 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('Index');
    if ($this->indexName !== null) {
      $xfer += $output->writeFieldBegin('indexName', TType::STRING, 1);
      $xfer += $output->writeString($this->indexName);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->indexHandlerClass !== null) {
      $xfer += $output->writeFieldBegin('indexHandlerClass', TType::STRING, 2);
      $xfer += $output->writeString($this->indexHandlerClass);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->dbName !== null) {
      $xfer += $output->writeFieldBegin('dbName', TType::STRING, 3);
      $xfer += $output->writeString($this->dbName);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->origTableName !== null) {
      $xfer += $output->writeFieldBegin('origTableName', TType::STRING, 4);
      $xfer += $output->writeString($this->origTableName);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->createTime !== null) {
      $xfer += $output->writeFieldBegin('createTime', TType::I32, 5);
      $xfer += $output->writeI32($this->createTime);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->lastAccessTime !== null) {
      $xfer += $output->writeFieldBegin('lastAccessTime', TType::I32, 6);
      $xfer += $output->writeI32($this->lastAccessTime);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->indexTableName !== null) {
      $xfer += $output->writeFieldBegin('indexTableName', TType::STRING, 7);
      $xfer += $output->writeString($this->indexTableName);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->sd !== null) {
      if (!is_object($this->sd)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('sd', TType::STRUCT, 8);
      $xfer += $this->sd->write($output);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->parameters !== null) {
      if (!is_array($this->parameters)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('parameters', TType::MAP, 9);
      {
        $output->writeMapBegin(TType::STRING, TType::STRING, count($this->parameters));
        {
          foreach ($this->parameters as $kiter237 => $viter238)
          {
            $xfer += $output->writeString($kiter237);
            $xfer += $output->writeString($viter238);
          }
        }
        $output->writeMapEnd();
      }
      $xfer += $output->writeFieldEnd();
    }
    if ($this->deferredRebuild !== null) {
      $xfer += $output->writeFieldBegin('deferredRebuild', TType::BOOL, 10);
      $xfer += $output->writeBool($this->deferredRebuild);
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class BooleanColumnStatsData {
  static $_TSPEC;

  /**
   * @var int
   */
  public $numTrues = null;
  /**
   * @var int
   */
  public $numFalses = null;
  /**
   * @var int
   */
  public $numNulls = null;
  /**
   * @var string
   */
  public $bitVectors = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'numTrues',
          'type' => TType::I64,
          ),
        2 => array(
          'var' => 'numFalses',
          'type' => TType::I64,
          ),
        3 => array(
          'var' => 'numNulls',
          'type' => TType::I64,
          ),
        4 => array(
          'var' => 'bitVectors',
          'type' => TType::STRING,
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['numTrues'])) {
        $this->numTrues = $vals['numTrues'];
      }
      if (isset($vals['numFalses'])) {
        $this->numFalses = $vals['numFalses'];
      }
      if (isset($vals['numNulls'])) {
        $this->numNulls = $vals['numNulls'];
      }
      if (isset($vals['bitVectors'])) {
        $this->bitVectors = $vals['bitVectors'];
      }
    }
  }

  public function getName() {
    return 'BooleanColumnStatsData';
  }

  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::I64) {
            $xfer += $input->readI64($this->numTrues);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 2:
          if ($ftype == TType::I64) {
            $xfer += $input->readI64($this->numFalses);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 3:
          if ($ftype == TType::I64) {
            $xfer += $input->readI64($this->numNulls);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 4:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->bitVectors);
          } 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('BooleanColumnStatsData');
    if ($this->numTrues !== null) {
      $xfer += $output->writeFieldBegin('numTrues', TType::I64, 1);
      $xfer += $output->writeI64($this->numTrues);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->numFalses !== null) {
      $xfer += $output->writeFieldBegin('numFalses', TType::I64, 2);
      $xfer += $output->writeI64($this->numFalses);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->numNulls !== null) {
      $xfer += $output->writeFieldBegin('numNulls', TType::I64, 3);
      $xfer += $output->writeI64($this->numNulls);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->bitVectors !== null) {
      $xfer += $output->writeFieldBegin('bitVectors', TType::STRING, 4);
      $xfer += $output->writeString($this->bitVectors);
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class DoubleColumnStatsData {
  static $_TSPEC;

  /**
   * @var double
   */
  public $lowValue = null;
  /**
   * @var double
   */
  public $highValue = null;
  /**
   * @var int
   */
  public $numNulls = null;
  /**
   * @var int
   */
  public $numDVs = null;
  /**
   * @var string
   */
  public $bitVectors = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'lowValue',
          'type' => TType::DOUBLE,
          ),
        2 => array(
          'var' => 'highValue',
          'type' => TType::DOUBLE,
          ),
        3 => array(
          'var' => 'numNulls',
          'type' => TType::I64,
          ),
        4 => array(
          'var' => 'numDVs',
          'type' => TType::I64,
          ),
        5 => array(
          'var' => 'bitVectors',
          'type' => TType::STRING,
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['lowValue'])) {
        $this->lowValue = $vals['lowValue'];
      }
      if (isset($vals['highValue'])) {
        $this->highValue = $vals['highValue'];
      }
      if (isset($vals['numNulls'])) {
        $this->numNulls = $vals['numNulls'];
      }
      if (isset($vals['numDVs'])) {
        $this->numDVs = $vals['numDVs'];
      }
      if (isset($vals['bitVectors'])) {
        $this->bitVectors = $vals['bitVectors'];
      }
    }
  }

  public function getName() {
    return 'DoubleColumnStatsData';
  }

  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::DOUBLE) {
            $xfer += $input->readDouble($this->lowValue);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 2:
          if ($ftype == TType::DOUBLE) {
            $xfer += $input->readDouble($this->highValue);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 3:
          if ($ftype == TType::I64) {
            $xfer += $input->readI64($this->numNulls);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 4:
          if ($ftype == TType::I64) {
            $xfer += $input->readI64($this->numDVs);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 5:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->bitVectors);
          } 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('DoubleColumnStatsData');
    if ($this->lowValue !== null) {
      $xfer += $output->writeFieldBegin('lowValue', TType::DOUBLE, 1);
      $xfer += $output->writeDouble($this->lowValue);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->highValue !== null) {
      $xfer += $output->writeFieldBegin('highValue', TType::DOUBLE, 2);
      $xfer += $output->writeDouble($this->highValue);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->numNulls !== null) {
      $xfer += $output->writeFieldBegin('numNulls', TType::I64, 3);
      $xfer += $output->writeI64($this->numNulls);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->numDVs !== null) {
      $xfer += $output->writeFieldBegin('numDVs', TType::I64, 4);
      $xfer += $output->writeI64($this->numDVs);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->bitVectors !== null) {
      $xfer += $output->writeFieldBegin('bitVectors', TType::STRING, 5);
      $xfer += $output->writeString($this->bitVectors);
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class LongColumnStatsData {
  static $_TSPEC;

  /**
   * @var int
   */
  public $lowValue = null;
  /**
   * @var int
   */
  public $highValue = null;
  /**
   * @var int
   */
  public $numNulls = null;
  /**
   * @var int
   */
  public $numDVs = null;
  /**
   * @var string
   */
  public $bitVectors = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'lowValue',
          'type' => TType::I64,
          ),
        2 => array(
          'var' => 'highValue',
          'type' => TType::I64,
          ),
        3 => array(
          'var' => 'numNulls',
          'type' => TType::I64,
          ),
        4 => array(
          'var' => 'numDVs',
          'type' => TType::I64,
          ),
        5 => array(
          'var' => 'bitVectors',
          'type' => TType::STRING,
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['lowValue'])) {
        $this->lowValue = $vals['lowValue'];
      }
      if (isset($vals['highValue'])) {
        $this->highValue = $vals['highValue'];
      }
      if (isset($vals['numNulls'])) {
        $this->numNulls = $vals['numNulls'];
      }
      if (isset($vals['numDVs'])) {
        $this->numDVs = $vals['numDVs'];
      }
      if (isset($vals['bitVectors'])) {
        $this->bitVectors = $vals['bitVectors'];
      }
    }
  }

  public function getName() {
    return 'LongColumnStatsData';
  }

  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::I64) {
            $xfer += $input->readI64($this->lowValue);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 2:
          if ($ftype == TType::I64) {
            $xfer += $input->readI64($this->highValue);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 3:
          if ($ftype == TType::I64) {
            $xfer += $input->readI64($this->numNulls);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 4:
          if ($ftype == TType::I64) {
            $xfer += $input->readI64($this->numDVs);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 5:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->bitVectors);
          } 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('LongColumnStatsData');
    if ($this->lowValue !== null) {
      $xfer += $output->writeFieldBegin('lowValue', TType::I64, 1);
      $xfer += $output->writeI64($this->lowValue);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->highValue !== null) {
      $xfer += $output->writeFieldBegin('highValue', TType::I64, 2);
      $xfer += $output->writeI64($this->highValue);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->numNulls !== null) {
      $xfer += $output->writeFieldBegin('numNulls', TType::I64, 3);
      $xfer += $output->writeI64($this->numNulls);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->numDVs !== null) {
      $xfer += $output->writeFieldBegin('numDVs', TType::I64, 4);
      $xfer += $output->writeI64($this->numDVs);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->bitVectors !== null) {
      $xfer += $output->writeFieldBegin('bitVectors', TType::STRING, 5);
      $xfer += $output->writeString($this->bitVectors);
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class StringColumnStatsData {
  static $_TSPEC;

  /**
   * @var int
   */
  public $maxColLen = null;
  /**
   * @var double
   */
  public $avgColLen = null;
  /**
   * @var int
   */
  public $numNulls = null;
  /**
   * @var int
   */
  public $numDVs = null;
  /**
   * @var string
   */
  public $bitVectors = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'maxColLen',
          'type' => TType::I64,
          ),
        2 => array(
          'var' => 'avgColLen',
          'type' => TType::DOUBLE,
          ),
        3 => array(
          'var' => 'numNulls',
          'type' => TType::I64,
          ),
        4 => array(
          'var' => 'numDVs',
          'type' => TType::I64,
          ),
        5 => array(
          'var' => 'bitVectors',
          'type' => TType::STRING,
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['maxColLen'])) {
        $this->maxColLen = $vals['maxColLen'];
      }
      if (isset($vals['avgColLen'])) {
        $this->avgColLen = $vals['avgColLen'];
      }
      if (isset($vals['numNulls'])) {
        $this->numNulls = $vals['numNulls'];
      }
      if (isset($vals['numDVs'])) {
        $this->numDVs = $vals['numDVs'];
      }
      if (isset($vals['bitVectors'])) {
        $this->bitVectors = $vals['bitVectors'];
      }
    }
  }

  public function getName() {
    return 'StringColumnStatsData';
  }

  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::I64) {
            $xfer += $input->readI64($this->maxColLen);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 2:
          if ($ftype == TType::DOUBLE) {
            $xfer += $input->readDouble($this->avgColLen);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 3:
          if ($ftype == TType::I64) {
            $xfer += $input->readI64($this->numNulls);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 4:
          if ($ftype == TType::I64) {
            $xfer += $input->readI64($this->numDVs);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 5:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->bitVectors);
          } 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('StringColumnStatsData');
    if ($this->maxColLen !== null) {
      $xfer += $output->writeFieldBegin('maxColLen', TType::I64, 1);
      $xfer += $output->writeI64($this->maxColLen);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->avgColLen !== null) {
      $xfer += $output->writeFieldBegin('avgColLen', TType::DOUBLE, 2);
      $xfer += $output->writeDouble($this->avgColLen);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->numNulls !== null) {
      $xfer += $output->writeFieldBegin('numNulls', TType::I64, 3);
      $xfer += $output->writeI64($this->numNulls);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->numDVs !== null) {
      $xfer += $output->writeFieldBegin('numDVs', TType::I64, 4);
      $xfer += $output->writeI64($this->numDVs);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->bitVectors !== null) {
      $xfer += $output->writeFieldBegin('bitVectors', TType::STRING, 5);
      $xfer += $output->writeString($this->bitVectors);
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class BinaryColumnStatsData {
  static $_TSPEC;

  /**
   * @var int
   */
  public $maxColLen = null;
  /**
   * @var double
   */
  public $avgColLen = null;
  /**
   * @var int
   */
  public $numNulls = null;
  /**
   * @var string
   */
  public $bitVectors = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'maxColLen',
          'type' => TType::I64,
          ),
        2 => array(
          'var' => 'avgColLen',
          'type' => TType::DOUBLE,
          ),
        3 => array(
          'var' => 'numNulls',
          'type' => TType::I64,
          ),
        4 => array(
          'var' => 'bitVectors',
          'type' => TType::STRING,
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['maxColLen'])) {
        $this->maxColLen = $vals['maxColLen'];
      }
      if (isset($vals['avgColLen'])) {
        $this->avgColLen = $vals['avgColLen'];
      }
      if (isset($vals['numNulls'])) {
        $this->numNulls = $vals['numNulls'];
      }
      if (isset($vals['bitVectors'])) {
        $this->bitVectors = $vals['bitVectors'];
      }
    }
  }

  public function getName() {
    return 'BinaryColumnStatsData';
  }

  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::I64) {
            $xfer += $input->readI64($this->maxColLen);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 2:
          if ($ftype == TType::DOUBLE) {
            $xfer += $input->readDouble($this->avgColLen);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 3:
          if ($ftype == TType::I64) {
            $xfer += $input->readI64($this->numNulls);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 4:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->bitVectors);
          } 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('BinaryColumnStatsData');
    if ($this->maxColLen !== null) {
      $xfer += $output->writeFieldBegin('maxColLen', TType::I64, 1);
      $xfer += $output->writeI64($this->maxColLen);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->avgColLen !== null) {
      $xfer += $output->writeFieldBegin('avgColLen', TType::DOUBLE, 2);
      $xfer += $output->writeDouble($this->avgColLen);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->numNulls !== null) {
      $xfer += $output->writeFieldBegin('numNulls', TType::I64, 3);
      $xfer += $output->writeI64($this->numNulls);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->bitVectors !== null) {
      $xfer += $output->writeFieldBegin('bitVectors', TType::STRING, 4);
      $xfer += $output->writeString($this->bitVectors);
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class Decimal {
  static $_TSPEC;

  /**
   * @var string
   */
  public $unscaled = null;
  /**
   * @var int
   */
  public $scale = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'unscaled',
          'type' => TType::STRING,
          ),
        3 => array(
          'var' => 'scale',
          'type' => TType::I16,
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['unscaled'])) {
        $this->unscaled = $vals['unscaled'];
      }
      if (isset($vals['scale'])) {
        $this->scale = $vals['scale'];
      }
    }
  }

  public function getName() {
    return 'Decimal';
  }

  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->unscaled);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 3:
          if ($ftype == TType::I16) {
            $xfer += $input->readI16($this->scale);
          } 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('Decimal');
    if ($this->unscaled !== null) {
      $xfer += $output->writeFieldBegin('unscaled', TType::STRING, 1);
      $xfer += $output->writeString($this->unscaled);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->scale !== null) {
      $xfer += $output->writeFieldBegin('scale', TType::I16, 3);
      $xfer += $output->writeI16($this->scale);
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class DecimalColumnStatsData {
  static $_TSPEC;

  /**
   * @var \metastore\Decimal
   */
  public $lowValue = null;
  /**
   * @var \metastore\Decimal
   */
  public $highValue = null;
  /**
   * @var int
   */
  public $numNulls = null;
  /**
   * @var int
   */
  public $numDVs = null;
  /**
   * @var string
   */
  public $bitVectors = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'lowValue',
          'type' => TType::STRUCT,
          'class' => '\metastore\Decimal',
          ),
        2 => array(
          'var' => 'highValue',
          'type' => TType::STRUCT,
          'class' => '\metastore\Decimal',
          ),
        3 => array(
          'var' => 'numNulls',
          'type' => TType::I64,
          ),
        4 => array(
          'var' => 'numDVs',
          'type' => TType::I64,
          ),
        5 => array(
          'var' => 'bitVectors',
          'type' => TType::STRING,
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['lowValue'])) {
        $this->lowValue = $vals['lowValue'];
      }
      if (isset($vals['highValue'])) {
        $this->highValue = $vals['highValue'];
      }
      if (isset($vals['numNulls'])) {
        $this->numNulls = $vals['numNulls'];
      }
      if (isset($vals['numDVs'])) {
        $this->numDVs = $vals['numDVs'];
      }
      if (isset($vals['bitVectors'])) {
        $this->bitVectors = $vals['bitVectors'];
      }
    }
  }

  public function getName() {
    return 'DecimalColumnStatsData';
  }

  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::STRUCT) {
            $this->lowValue = new \metastore\Decimal();
            $xfer += $this->lowValue->read($input);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 2:
          if ($ftype == TType::STRUCT) {
            $this->highValue = new \metastore\Decimal();
            $xfer += $this->highValue->read($input);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 3:
          if ($ftype == TType::I64) {
            $xfer += $input->readI64($this->numNulls);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 4:
          if ($ftype == TType::I64) {
            $xfer += $input->readI64($this->numDVs);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 5:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->bitVectors);
          } 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('DecimalColumnStatsData');
    if ($this->lowValue !== null) {
      if (!is_object($this->lowValue)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('lowValue', TType::STRUCT, 1);
      $xfer += $this->lowValue->write($output);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->highValue !== null) {
      if (!is_object($this->highValue)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('highValue', TType::STRUCT, 2);
      $xfer += $this->highValue->write($output);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->numNulls !== null) {
      $xfer += $output->writeFieldBegin('numNulls', TType::I64, 3);
      $xfer += $output->writeI64($this->numNulls);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->numDVs !== null) {
      $xfer += $output->writeFieldBegin('numDVs', TType::I64, 4);
      $xfer += $output->writeI64($this->numDVs);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->bitVectors !== null) {
      $xfer += $output->writeFieldBegin('bitVectors', TType::STRING, 5);
      $xfer += $output->writeString($this->bitVectors);
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class Date {
  static $_TSPEC;

  /**
   * @var int
   */
  public $daysSinceEpoch = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'daysSinceEpoch',
          'type' => TType::I64,
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['daysSinceEpoch'])) {
        $this->daysSinceEpoch = $vals['daysSinceEpoch'];
      }
    }
  }

  public function getName() {
    return 'Date';
  }

  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::I64) {
            $xfer += $input->readI64($this->daysSinceEpoch);
          } 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('Date');
    if ($this->daysSinceEpoch !== null) {
      $xfer += $output->writeFieldBegin('daysSinceEpoch', TType::I64, 1);
      $xfer += $output->writeI64($this->daysSinceEpoch);
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class DateColumnStatsData {
  static $_TSPEC;

  /**
   * @var \metastore\Date
   */
  public $lowValue = null;
  /**
   * @var \metastore\Date
   */
  public $highValue = null;
  /**
   * @var int
   */
  public $numNulls = null;
  /**
   * @var int
   */
  public $numDVs = null;
  /**
   * @var string
   */
  public $bitVectors = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'lowValue',
          'type' => TType::STRUCT,
          'class' => '\metastore\Date',
          ),
        2 => array(
          'var' => 'highValue',
          'type' => TType::STRUCT,
          'class' => '\metastore\Date',
          ),
        3 => array(
          'var' => 'numNulls',
          'type' => TType::I64,
          ),
        4 => array(
          'var' => 'numDVs',
          'type' => TType::I64,
          ),
        5 => array(
          'var' => 'bitVectors',
          'type' => TType::STRING,
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['lowValue'])) {
        $this->lowValue = $vals['lowValue'];
      }
      if (isset($vals['highValue'])) {
        $this->highValue = $vals['highValue'];
      }
      if (isset($vals['numNulls'])) {
        $this->numNulls = $vals['numNulls'];
      }
      if (isset($vals['numDVs'])) {
        $this->numDVs = $vals['numDVs'];
      }
      if (isset($vals['bitVectors'])) {
        $this->bitVectors = $vals['bitVectors'];
      }
    }
  }

  public function getName() {
    return 'DateColumnStatsData';
  }

  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::STRUCT) {
            $this->lowValue = new \metastore\Date();
            $xfer += $this->lowValue->read($input);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 2:
          if ($ftype == TType::STRUCT) {
            $this->highValue = new \metastore\Date();
            $xfer += $this->highValue->read($input);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 3:
          if ($ftype == TType::I64) {
            $xfer += $input->readI64($this->numNulls);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 4:
          if ($ftype == TType::I64) {
            $xfer += $input->readI64($this->numDVs);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 5:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->bitVectors);
          } 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('DateColumnStatsData');
    if ($this->lowValue !== null) {
      if (!is_object($this->lowValue)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('lowValue', TType::STRUCT, 1);
      $xfer += $this->lowValue->write($output);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->highValue !== null) {
      if (!is_object($this->highValue)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('highValue', TType::STRUCT, 2);
      $xfer += $this->highValue->write($output);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->numNulls !== null) {
      $xfer += $output->writeFieldBegin('numNulls', TType::I64, 3);
      $xfer += $output->writeI64($this->numNulls);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->numDVs !== null) {
      $xfer += $output->writeFieldBegin('numDVs', TType::I64, 4);
      $xfer += $output->writeI64($this->numDVs);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->bitVectors !== null) {
      $xfer += $output->writeFieldBegin('bitVectors', TType::STRING, 5);
      $xfer += $output->writeString($this->bitVectors);
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class ColumnStatisticsData {
  static $_TSPEC;

  /**
   * @var \metastore\BooleanColumnStatsData
   */
  public $booleanStats = null;
  /**
   * @var \metastore\LongColumnStatsData
   */
  public $longStats = null;
  /**
   * @var \metastore\DoubleColumnStatsData
   */
  public $doubleStats = null;
  /**
   * @var \metastore\StringColumnStatsData
   */
  public $stringStats = null;
  /**
   * @var \metastore\BinaryColumnStatsData
   */
  public $binaryStats = null;
  /**
   * @var \metastore\DecimalColumnStatsData
   */
  public $decimalStats = null;
  /**
   * @var \metastore\DateColumnStatsData
   */
  public $dateStats = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'booleanStats',
          'type' => TType::STRUCT,
          'class' => '\metastore\BooleanColumnStatsData',
          ),
        2 => array(
          'var' => 'longStats',
          'type' => TType::STRUCT,
          'class' => '\metastore\LongColumnStatsData',
          ),
        3 => array(
          'var' => 'doubleStats',
          'type' => TType::STRUCT,
          'class' => '\metastore\DoubleColumnStatsData',
          ),
        4 => array(
          'var' => 'stringStats',
          'type' => TType::STRUCT,
          'class' => '\metastore\StringColumnStatsData',
          ),
        5 => array(
          'var' => 'binaryStats',
          'type' => TType::STRUCT,
          'class' => '\metastore\BinaryColumnStatsData',
          ),
        6 => array(
          'var' => 'decimalStats',
          'type' => TType::STRUCT,
          'class' => '\metastore\DecimalColumnStatsData',
          ),
        7 => array(
          'var' => 'dateStats',
          'type' => TType::STRUCT,
          'class' => '\metastore\DateColumnStatsData',
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['booleanStats'])) {
        $this->booleanStats = $vals['booleanStats'];
      }
      if (isset($vals['longStats'])) {
        $this->longStats = $vals['longStats'];
      }
      if (isset($vals['doubleStats'])) {
        $this->doubleStats = $vals['doubleStats'];
      }
      if (isset($vals['stringStats'])) {
        $this->stringStats = $vals['stringStats'];
      }
      if (isset($vals['binaryStats'])) {
        $this->binaryStats = $vals['binaryStats'];
      }
      if (isset($vals['decimalStats'])) {
        $this->decimalStats = $vals['decimalStats'];
      }
      if (isset($vals['dateStats'])) {
        $this->dateStats = $vals['dateStats'];
      }
    }
  }

  public function getName() {
    return 'ColumnStatisticsData';
  }

  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::STRUCT) {
            $this->booleanStats = new \metastore\BooleanColumnStatsData();
            $xfer += $this->booleanStats->read($input);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 2:
          if ($ftype == TType::STRUCT) {
            $this->longStats = new \metastore\LongColumnStatsData();
            $xfer += $this->longStats->read($input);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 3:
          if ($ftype == TType::STRUCT) {
            $this->doubleStats = new \metastore\DoubleColumnStatsData();
            $xfer += $this->doubleStats->read($input);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 4:
          if ($ftype == TType::STRUCT) {
            $this->stringStats = new \metastore\StringColumnStatsData();
            $xfer += $this->stringStats->read($input);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 5:
          if ($ftype == TType::STRUCT) {
            $this->binaryStats = new \metastore\BinaryColumnStatsData();
            $xfer += $this->binaryStats->read($input);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 6:
          if ($ftype == TType::STRUCT) {
            $this->decimalStats = new \metastore\DecimalColumnStatsData();
            $xfer += $this->decimalStats->read($input);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 7:
          if ($ftype == TType::STRUCT) {
            $this->dateStats = new \metastore\DateColumnStatsData();
            $xfer += $this->dateStats->read($input);
          } 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('ColumnStatisticsData');
    if ($this->booleanStats !== null) {
      if (!is_object($this->booleanStats)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('booleanStats', TType::STRUCT, 1);
      $xfer += $this->booleanStats->write($output);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->longStats !== null) {
      if (!is_object($this->longStats)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('longStats', TType::STRUCT, 2);
      $xfer += $this->longStats->write($output);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->doubleStats !== null) {
      if (!is_object($this->doubleStats)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('doubleStats', TType::STRUCT, 3);
      $xfer += $this->doubleStats->write($output);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->stringStats !== null) {
      if (!is_object($this->stringStats)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('stringStats', TType::STRUCT, 4);
      $xfer += $this->stringStats->write($output);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->binaryStats !== null) {
      if (!is_object($this->binaryStats)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('binaryStats', TType::STRUCT, 5);
      $xfer += $this->binaryStats->write($output);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->decimalStats !== null) {
      if (!is_object($this->decimalStats)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('decimalStats', TType::STRUCT, 6);
      $xfer += $this->decimalStats->write($output);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->dateStats !== null) {
      if (!is_object($this->dateStats)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('dateStats', TType::STRUCT, 7);
      $xfer += $this->dateStats->write($output);
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class ColumnStatisticsObj {
  static $_TSPEC;

  /**
   * @var string
   */
  public $colName = null;
  /**
   * @var string
   */
  public $colType = null;
  /**
   * @var \metastore\ColumnStatisticsData
   */
  public $statsData = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'colName',
          'type' => TType::STRING,
          ),
        2 => array(
          'var' => 'colType',
          'type' => TType::STRING,
          ),
        3 => array(
          'var' => 'statsData',
          'type' => TType::STRUCT,
          'class' => '\metastore\ColumnStatisticsData',
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['colName'])) {
        $this->colName = $vals['colName'];
      }
      if (isset($vals['colType'])) {
        $this->colType = $vals['colType'];
      }
      if (isset($vals['statsData'])) {
        $this->statsData = $vals['statsData'];
      }
    }
  }

  public function getName() {
    return 'ColumnStatisticsObj';
  }

  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->colName);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 2:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->colType);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 3:
          if ($ftype == TType::STRUCT) {
            $this->statsData = new \metastore\ColumnStatisticsData();
            $xfer += $this->statsData->read($input);
          } 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('ColumnStatisticsObj');
    if ($this->colName !== null) {
      $xfer += $output->writeFieldBegin('colName', TType::STRING, 1);
      $xfer += $output->writeString($this->colName);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->colType !== null) {
      $xfer += $output->writeFieldBegin('colType', TType::STRING, 2);
      $xfer += $output->writeString($this->colType);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->statsData !== null) {
      if (!is_object($this->statsData)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('statsData', TType::STRUCT, 3);
      $xfer += $this->statsData->write($output);
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class ColumnStatisticsDesc {
  static $_TSPEC;

  /**
   * @var bool
   */
  public $isTblLevel = null;
  /**
   * @var string
   */
  public $dbName = null;
  /**
   * @var string
   */
  public $tableName = null;
  /**
   * @var string
   */
  public $partName = null;
  /**
   * @var int
   */
  public $lastAnalyzed = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'isTblLevel',
          'type' => TType::BOOL,
          ),
        2 => array(
          'var' => 'dbName',
          'type' => TType::STRING,
          ),
        3 => array(
          'var' => 'tableName',
          'type' => TType::STRING,
          ),
        4 => array(
          'var' => 'partName',
          'type' => TType::STRING,
          ),
        5 => array(
          'var' => 'lastAnalyzed',
          'type' => TType::I64,
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['isTblLevel'])) {
        $this->isTblLevel = $vals['isTblLevel'];
      }
      if (isset($vals['dbName'])) {
        $this->dbName = $vals['dbName'];
      }
      if (isset($vals['tableName'])) {
        $this->tableName = $vals['tableName'];
      }
      if (isset($vals['partName'])) {
        $this->partName = $vals['partName'];
      }
      if (isset($vals['lastAnalyzed'])) {
        $this->lastAnalyzed = $vals['lastAnalyzed'];
      }
    }
  }

  public function getName() {
    return 'ColumnStatisticsDesc';
  }

  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::BOOL) {
            $xfer += $input->readBool($this->isTblLevel);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 2:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->dbName);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 3:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->tableName);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 4:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->partName);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 5:
          if ($ftype == TType::I64) {
            $xfer += $input->readI64($this->lastAnalyzed);
          } 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('ColumnStatisticsDesc');
    if ($this->isTblLevel !== null) {
      $xfer += $output->writeFieldBegin('isTblLevel', TType::BOOL, 1);
      $xfer += $output->writeBool($this->isTblLevel);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->dbName !== null) {
      $xfer += $output->writeFieldBegin('dbName', TType::STRING, 2);
      $xfer += $output->writeString($this->dbName);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->tableName !== null) {
      $xfer += $output->writeFieldBegin('tableName', TType::STRING, 3);
      $xfer += $output->writeString($this->tableName);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->partName !== null) {
      $xfer += $output->writeFieldBegin('partName', TType::STRING, 4);
      $xfer += $output->writeString($this->partName);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->lastAnalyzed !== null) {
      $xfer += $output->writeFieldBegin('lastAnalyzed', TType::I64, 5);
      $xfer += $output->writeI64($this->lastAnalyzed);
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class ColumnStatistics {
  static $_TSPEC;

  /**
   * @var \metastore\ColumnStatisticsDesc
   */
  public $statsDesc = null;
  /**
   * @var \metastore\ColumnStatisticsObj[]
   */
  public $statsObj = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'statsDesc',
          'type' => TType::STRUCT,
          'class' => '\metastore\ColumnStatisticsDesc',
          ),
        2 => array(
          'var' => 'statsObj',
          'type' => TType::LST,
          'etype' => TType::STRUCT,
          'elem' => array(
            'type' => TType::STRUCT,
            'class' => '\metastore\ColumnStatisticsObj',
            ),
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['statsDesc'])) {
        $this->statsDesc = $vals['statsDesc'];
      }
      if (isset($vals['statsObj'])) {
        $this->statsObj = $vals['statsObj'];
      }
    }
  }

  public function getName() {
    return 'ColumnStatistics';
  }

  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::STRUCT) {
            $this->statsDesc = new \metastore\ColumnStatisticsDesc();
            $xfer += $this->statsDesc->read($input);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 2:
          if ($ftype == TType::LST) {
            $this->statsObj = array();
            $_size239 = 0;
            $_etype242 = 0;
            $xfer += $input->readListBegin($_etype242, $_size239);
            for ($_i243 = 0; $_i243 < $_size239; ++$_i243)
            {
              $elem244 = null;
              $elem244 = new \metastore\ColumnStatisticsObj();
              $xfer += $elem244->read($input);
              $this->statsObj []= $elem244;
            }
            $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('ColumnStatistics');
    if ($this->statsDesc !== null) {
      if (!is_object($this->statsDesc)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('statsDesc', TType::STRUCT, 1);
      $xfer += $this->statsDesc->write($output);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->statsObj !== null) {
      if (!is_array($this->statsObj)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('statsObj', TType::LST, 2);
      {
        $output->writeListBegin(TType::STRUCT, count($this->statsObj));
        {
          foreach ($this->statsObj as $iter245)
          {
            $xfer += $iter245->write($output);
          }
        }
        $output->writeListEnd();
      }
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class AggrStats {
  static $_TSPEC;

  /**
   * @var \metastore\ColumnStatisticsObj[]
   */
  public $colStats = null;
  /**
   * @var int
   */
  public $partsFound = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'colStats',
          'type' => TType::LST,
          'etype' => TType::STRUCT,
          'elem' => array(
            'type' => TType::STRUCT,
            'class' => '\metastore\ColumnStatisticsObj',
            ),
          ),
        2 => array(
          'var' => 'partsFound',
          'type' => TType::I64,
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['colStats'])) {
        $this->colStats = $vals['colStats'];
      }
      if (isset($vals['partsFound'])) {
        $this->partsFound = $vals['partsFound'];
      }
    }
  }

  public function getName() {
    return 'AggrStats';
  }

  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->colStats = array();
            $_size246 = 0;
            $_etype249 = 0;
            $xfer += $input->readListBegin($_etype249, $_size246);
            for ($_i250 = 0; $_i250 < $_size246; ++$_i250)
            {
              $elem251 = null;
              $elem251 = new \metastore\ColumnStatisticsObj();
              $xfer += $elem251->read($input);
              $this->colStats []= $elem251;
            }
            $xfer += $input->readListEnd();
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 2:
          if ($ftype == TType::I64) {
            $xfer += $input->readI64($this->partsFound);
          } 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('AggrStats');
    if ($this->colStats !== null) {
      if (!is_array($this->colStats)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('colStats', TType::LST, 1);
      {
        $output->writeListBegin(TType::STRUCT, count($this->colStats));
        {
          foreach ($this->colStats as $iter252)
          {
            $xfer += $iter252->write($output);
          }
        }
        $output->writeListEnd();
      }
      $xfer += $output->writeFieldEnd();
    }
    if ($this->partsFound !== null) {
      $xfer += $output->writeFieldBegin('partsFound', TType::I64, 2);
      $xfer += $output->writeI64($this->partsFound);
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class SetPartitionsStatsRequest {
  static $_TSPEC;

  /**
   * @var \metastore\ColumnStatistics[]
   */
  public $colStats = null;
  /**
   * @var bool
   */
  public $needMerge = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'colStats',
          'type' => TType::LST,
          'etype' => TType::STRUCT,
          'elem' => array(
            'type' => TType::STRUCT,
            'class' => '\metastore\ColumnStatistics',
            ),
          ),
        2 => array(
          'var' => 'needMerge',
          'type' => TType::BOOL,
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['colStats'])) {
        $this->colStats = $vals['colStats'];
      }
      if (isset($vals['needMerge'])) {
        $this->needMerge = $vals['needMerge'];
      }
    }
  }

  public function getName() {
    return 'SetPartitionsStatsRequest';
  }

  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->colStats = array();
            $_size253 = 0;
            $_etype256 = 0;
            $xfer += $input->readListBegin($_etype256, $_size253);
            for ($_i257 = 0; $_i257 < $_size253; ++$_i257)
            {
              $elem258 = null;
              $elem258 = new \metastore\ColumnStatistics();
              $xfer += $elem258->read($input);
              $this->colStats []= $elem258;
            }
            $xfer += $input->readListEnd();
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 2:
          if ($ftype == TType::BOOL) {
            $xfer += $input->readBool($this->needMerge);
          } 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('SetPartitionsStatsRequest');
    if ($this->colStats !== null) {
      if (!is_array($this->colStats)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('colStats', TType::LST, 1);
      {
        $output->writeListBegin(TType::STRUCT, count($this->colStats));
        {
          foreach ($this->colStats as $iter259)
          {
            $xfer += $iter259->write($output);
          }
        }
        $output->writeListEnd();
      }
      $xfer += $output->writeFieldEnd();
    }
    if ($this->needMerge !== null) {
      $xfer += $output->writeFieldBegin('needMerge', TType::BOOL, 2);
      $xfer += $output->writeBool($this->needMerge);
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class Schema {
  static $_TSPEC;

  /**
   * @var \metastore\FieldSchema[]
   */
  public $fieldSchemas = null;
  /**
   * @var array
   */
  public $properties = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'fieldSchemas',
          'type' => TType::LST,
          'etype' => TType::STRUCT,
          'elem' => array(
            'type' => TType::STRUCT,
            'class' => '\metastore\FieldSchema',
            ),
          ),
        2 => array(
          'var' => 'properties',
          'type' => TType::MAP,
          'ktype' => TType::STRING,
          'vtype' => TType::STRING,
          'key' => array(
            'type' => TType::STRING,
          ),
          'val' => array(
            'type' => TType::STRING,
            ),
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['fieldSchemas'])) {
        $this->fieldSchemas = $vals['fieldSchemas'];
      }
      if (isset($vals['properties'])) {
        $this->properties = $vals['properties'];
      }
    }
  }

  public function getName() {
    return 'Schema';
  }

  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->fieldSchemas = array();
            $_size260 = 0;
            $_etype263 = 0;
            $xfer += $input->readListBegin($_etype263, $_size260);
            for ($_i264 = 0; $_i264 < $_size260; ++$_i264)
            {
              $elem265 = null;
              $elem265 = new \metastore\FieldSchema();
              $xfer += $elem265->read($input);
              $this->fieldSchemas []= $elem265;
            }
            $xfer += $input->readListEnd();
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 2:
          if ($ftype == TType::MAP) {
            $this->properties = array();
            $_size266 = 0;
            $_ktype267 = 0;
            $_vtype268 = 0;
            $xfer += $input->readMapBegin($_ktype267, $_vtype268, $_size266);
            for ($_i270 = 0; $_i270 < $_size266; ++$_i270)
            {
              $key271 = '';
              $val272 = '';
              $xfer += $input->readString($key271);
              $xfer += $input->readString($val272);
              $this->properties[$key271] = $val272;
            }
            $xfer += $input->readMapEnd();
          } 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('Schema');
    if ($this->fieldSchemas !== null) {
      if (!is_array($this->fieldSchemas)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('fieldSchemas', TType::LST, 1);
      {
        $output->writeListBegin(TType::STRUCT, count($this->fieldSchemas));
        {
          foreach ($this->fieldSchemas as $iter273)
          {
            $xfer += $iter273->write($output);
          }
        }
        $output->writeListEnd();
      }
      $xfer += $output->writeFieldEnd();
    }
    if ($this->properties !== null) {
      if (!is_array($this->properties)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('properties', TType::MAP, 2);
      {
        $output->writeMapBegin(TType::STRING, TType::STRING, count($this->properties));
        {
          foreach ($this->properties as $kiter274 => $viter275)
          {
            $xfer += $output->writeString($kiter274);
            $xfer += $output->writeString($viter275);
          }
        }
        $output->writeMapEnd();
      }
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class EnvironmentContext {
  static $_TSPEC;

  /**
   * @var array
   */
  public $properties = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'properties',
          'type' => TType::MAP,
          'ktype' => TType::STRING,
          'vtype' => TType::STRING,
          'key' => array(
            'type' => TType::STRING,
          ),
          'val' => array(
            'type' => TType::STRING,
            ),
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['properties'])) {
        $this->properties = $vals['properties'];
      }
    }
  }

  public function getName() {
    return 'EnvironmentContext';
  }

  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::MAP) {
            $this->properties = array();
            $_size276 = 0;
            $_ktype277 = 0;
            $_vtype278 = 0;
            $xfer += $input->readMapBegin($_ktype277, $_vtype278, $_size276);
            for ($_i280 = 0; $_i280 < $_size276; ++$_i280)
            {
              $key281 = '';
              $val282 = '';
              $xfer += $input->readString($key281);
              $xfer += $input->readString($val282);
              $this->properties[$key281] = $val282;
            }
            $xfer += $input->readMapEnd();
          } 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('EnvironmentContext');
    if ($this->properties !== null) {
      if (!is_array($this->properties)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('properties', TType::MAP, 1);
      {
        $output->writeMapBegin(TType::STRING, TType::STRING, count($this->properties));
        {
          foreach ($this->properties as $kiter283 => $viter284)
          {
            $xfer += $output->writeString($kiter283);
            $xfer += $output->writeString($viter284);
          }
        }
        $output->writeMapEnd();
      }
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class PrimaryKeysRequest {
  static $_TSPEC;

  /**
   * @var string
   */
  public $db_name = null;
  /**
   * @var string
   */
  public $tbl_name = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'db_name',
          'type' => TType::STRING,
          ),
        2 => array(
          'var' => 'tbl_name',
          'type' => TType::STRING,
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['db_name'])) {
        $this->db_name = $vals['db_name'];
      }
      if (isset($vals['tbl_name'])) {
        $this->tbl_name = $vals['tbl_name'];
      }
    }
  }

  public function getName() {
    return 'PrimaryKeysRequest';
  }

  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->db_name);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 2:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->tbl_name);
          } 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('PrimaryKeysRequest');
    if ($this->db_name !== null) {
      $xfer += $output->writeFieldBegin('db_name', TType::STRING, 1);
      $xfer += $output->writeString($this->db_name);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->tbl_name !== null) {
      $xfer += $output->writeFieldBegin('tbl_name', TType::STRING, 2);
      $xfer += $output->writeString($this->tbl_name);
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class PrimaryKeysResponse {
  static $_TSPEC;

  /**
   * @var \metastore\SQLPrimaryKey[]
   */
  public $primaryKeys = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'primaryKeys',
          'type' => TType::LST,
          'etype' => TType::STRUCT,
          'elem' => array(
            'type' => TType::STRUCT,
            'class' => '\metastore\SQLPrimaryKey',
            ),
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['primaryKeys'])) {
        $this->primaryKeys = $vals['primaryKeys'];
      }
    }
  }

  public function getName() {
    return 'PrimaryKeysResponse';
  }

  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->primaryKeys = array();
            $_size285 = 0;
            $_etype288 = 0;
            $xfer += $input->readListBegin($_etype288, $_size285);
            for ($_i289 = 0; $_i289 < $_size285; ++$_i289)
            {
              $elem290 = null;
              $elem290 = new \metastore\SQLPrimaryKey();
              $xfer += $elem290->read($input);
              $this->primaryKeys []= $elem290;
            }
            $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('PrimaryKeysResponse');
    if ($this->primaryKeys !== null) {
      if (!is_array($this->primaryKeys)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('primaryKeys', TType::LST, 1);
      {
        $output->writeListBegin(TType::STRUCT, count($this->primaryKeys));
        {
          foreach ($this->primaryKeys as $iter291)
          {
            $xfer += $iter291->write($output);
          }
        }
        $output->writeListEnd();
      }
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class ForeignKeysRequest {
  static $_TSPEC;

  /**
   * @var string
   */
  public $parent_db_name = null;
  /**
   * @var string
   */
  public $parent_tbl_name = null;
  /**
   * @var string
   */
  public $foreign_db_name = null;
  /**
   * @var string
   */
  public $foreign_tbl_name = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'parent_db_name',
          'type' => TType::STRING,
          ),
        2 => array(
          'var' => 'parent_tbl_name',
          'type' => TType::STRING,
          ),
        3 => array(
          'var' => 'foreign_db_name',
          'type' => TType::STRING,
          ),
        4 => array(
          'var' => 'foreign_tbl_name',
          'type' => TType::STRING,
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['parent_db_name'])) {
        $this->parent_db_name = $vals['parent_db_name'];
      }
      if (isset($vals['parent_tbl_name'])) {
        $this->parent_tbl_name = $vals['parent_tbl_name'];
      }
      if (isset($vals['foreign_db_name'])) {
        $this->foreign_db_name = $vals['foreign_db_name'];
      }
      if (isset($vals['foreign_tbl_name'])) {
        $this->foreign_tbl_name = $vals['foreign_tbl_name'];
      }
    }
  }

  public function getName() {
    return 'ForeignKeysRequest';
  }

  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->parent_db_name);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 2:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->parent_tbl_name);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 3:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->foreign_db_name);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 4:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->foreign_tbl_name);
          } 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('ForeignKeysRequest');
    if ($this->parent_db_name !== null) {
      $xfer += $output->writeFieldBegin('parent_db_name', TType::STRING, 1);
      $xfer += $output->writeString($this->parent_db_name);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->parent_tbl_name !== null) {
      $xfer += $output->writeFieldBegin('parent_tbl_name', TType::STRING, 2);
      $xfer += $output->writeString($this->parent_tbl_name);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->foreign_db_name !== null) {
      $xfer += $output->writeFieldBegin('foreign_db_name', TType::STRING, 3);
      $xfer += $output->writeString($this->foreign_db_name);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->foreign_tbl_name !== null) {
      $xfer += $output->writeFieldBegin('foreign_tbl_name', TType::STRING, 4);
      $xfer += $output->writeString($this->foreign_tbl_name);
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class ForeignKeysResponse {
  static $_TSPEC;

  /**
   * @var \metastore\SQLForeignKey[]
   */
  public $foreignKeys = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'foreignKeys',
          'type' => TType::LST,
          'etype' => TType::STRUCT,
          'elem' => array(
            'type' => TType::STRUCT,
            'class' => '\metastore\SQLForeignKey',
            ),
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['foreignKeys'])) {
        $this->foreignKeys = $vals['foreignKeys'];
      }
    }
  }

  public function getName() {
    return 'ForeignKeysResponse';
  }

  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->foreignKeys = array();
            $_size292 = 0;
            $_etype295 = 0;
            $xfer += $input->readListBegin($_etype295, $_size292);
            for ($_i296 = 0; $_i296 < $_size292; ++$_i296)
            {
              $elem297 = null;
              $elem297 = new \metastore\SQLForeignKey();
              $xfer += $elem297->read($input);
              $this->foreignKeys []= $elem297;
            }
            $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('ForeignKeysResponse');
    if ($this->foreignKeys !== null) {
      if (!is_array($this->foreignKeys)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('foreignKeys', TType::LST, 1);
      {
        $output->writeListBegin(TType::STRUCT, count($this->foreignKeys));
        {
          foreach ($this->foreignKeys as $iter298)
          {
            $xfer += $iter298->write($output);
          }
        }
        $output->writeListEnd();
      }
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class DropConstraintRequest {
  static $_TSPEC;

  /**
   * @var string
   */
  public $dbname = null;
  /**
   * @var string
   */
  public $tablename = null;
  /**
   * @var string
   */
  public $constraintname = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'dbname',
          'type' => TType::STRING,
          ),
        2 => array(
          'var' => 'tablename',
          'type' => TType::STRING,
          ),
        3 => array(
          'var' => 'constraintname',
          'type' => TType::STRING,
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['dbname'])) {
        $this->dbname = $vals['dbname'];
      }
      if (isset($vals['tablename'])) {
        $this->tablename = $vals['tablename'];
      }
      if (isset($vals['constraintname'])) {
        $this->constraintname = $vals['constraintname'];
      }
    }
  }

  public function getName() {
    return 'DropConstraintRequest';
  }

  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->dbname);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 2:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->tablename);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 3:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->constraintname);
          } 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('DropConstraintRequest');
    if ($this->dbname !== null) {
      $xfer += $output->writeFieldBegin('dbname', TType::STRING, 1);
      $xfer += $output->writeString($this->dbname);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->tablename !== null) {
      $xfer += $output->writeFieldBegin('tablename', TType::STRING, 2);
      $xfer += $output->writeString($this->tablename);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->constraintname !== null) {
      $xfer += $output->writeFieldBegin('constraintname', TType::STRING, 3);
      $xfer += $output->writeString($this->constraintname);
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class AddPrimaryKeyRequest {
  static $_TSPEC;

  /**
   * @var \metastore\SQLPrimaryKey[]
   */
  public $primaryKeyCols = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'primaryKeyCols',
          'type' => TType::LST,
          'etype' => TType::STRUCT,
          'elem' => array(
            'type' => TType::STRUCT,
            'class' => '\metastore\SQLPrimaryKey',
            ),
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['primaryKeyCols'])) {
        $this->primaryKeyCols = $vals['primaryKeyCols'];
      }
    }
  }

  public function getName() {
    return 'AddPrimaryKeyRequest';
  }

  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->primaryKeyCols = array();
            $_size299 = 0;
            $_etype302 = 0;
            $xfer += $input->readListBegin($_etype302, $_size299);
            for ($_i303 = 0; $_i303 < $_size299; ++$_i303)
            {
              $elem304 = null;
              $elem304 = new \metastore\SQLPrimaryKey();
              $xfer += $elem304->read($input);
              $this->primaryKeyCols []= $elem304;
            }
            $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('AddPrimaryKeyRequest');
    if ($this->primaryKeyCols !== null) {
      if (!is_array($this->primaryKeyCols)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('primaryKeyCols', TType::LST, 1);
      {
        $output->writeListBegin(TType::STRUCT, count($this->primaryKeyCols));
        {
          foreach ($this->primaryKeyCols as $iter305)
          {
            $xfer += $iter305->write($output);
          }
        }
        $output->writeListEnd();
      }
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class AddForeignKeyRequest {
  static $_TSPEC;

  /**
   * @var \metastore\SQLForeignKey[]
   */
  public $foreignKeyCols = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'foreignKeyCols',
          'type' => TType::LST,
          'etype' => TType::STRUCT,
          'elem' => array(
            'type' => TType::STRUCT,
            'class' => '\metastore\SQLForeignKey',
            ),
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['foreignKeyCols'])) {
        $this->foreignKeyCols = $vals['foreignKeyCols'];
      }
    }
  }

  public function getName() {
    return 'AddForeignKeyRequest';
  }

  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->foreignKeyCols = array();
            $_size306 = 0;
            $_etype309 = 0;
            $xfer += $input->readListBegin($_etype309, $_size306);
            for ($_i310 = 0; $_i310 < $_size306; ++$_i310)
            {
              $elem311 = null;
              $elem311 = new \metastore\SQLForeignKey();
              $xfer += $elem311->read($input);
              $this->foreignKeyCols []= $elem311;
            }
            $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('AddForeignKeyRequest');
    if ($this->foreignKeyCols !== null) {
      if (!is_array($this->foreignKeyCols)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('foreignKeyCols', TType::LST, 1);
      {
        $output->writeListBegin(TType::STRUCT, count($this->foreignKeyCols));
        {
          foreach ($this->foreignKeyCols as $iter312)
          {
            $xfer += $iter312->write($output);
          }
        }
        $output->writeListEnd();
      }
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class PartitionsByExprResult {
  static $_TSPEC;

  /**
   * @var \metastore\Partition[]
   */
  public $partitions = null;
  /**
   * @var bool
   */
  public $hasUnknownPartitions = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'partitions',
          'type' => TType::LST,
          'etype' => TType::STRUCT,
          'elem' => array(
            'type' => TType::STRUCT,
            'class' => '\metastore\Partition',
            ),
          ),
        2 => array(
          'var' => 'hasUnknownPartitions',
          'type' => TType::BOOL,
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['partitions'])) {
        $this->partitions = $vals['partitions'];
      }
      if (isset($vals['hasUnknownPartitions'])) {
        $this->hasUnknownPartitions = $vals['hasUnknownPartitions'];
      }
    }
  }

  public function getName() {
    return 'PartitionsByExprResult';
  }

  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->partitions = array();
            $_size313 = 0;
            $_etype316 = 0;
            $xfer += $input->readListBegin($_etype316, $_size313);
            for ($_i317 = 0; $_i317 < $_size313; ++$_i317)
            {
              $elem318 = null;
              $elem318 = new \metastore\Partition();
              $xfer += $elem318->read($input);
              $this->partitions []= $elem318;
            }
            $xfer += $input->readListEnd();
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 2:
          if ($ftype == TType::BOOL) {
            $xfer += $input->readBool($this->hasUnknownPartitions);
          } 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('PartitionsByExprResult');
    if ($this->partitions !== null) {
      if (!is_array($this->partitions)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('partitions', TType::LST, 1);
      {
        $output->writeListBegin(TType::STRUCT, count($this->partitions));
        {
          foreach ($this->partitions as $iter319)
          {
            $xfer += $iter319->write($output);
          }
        }
        $output->writeListEnd();
      }
      $xfer += $output->writeFieldEnd();
    }
    if ($this->hasUnknownPartitions !== null) {
      $xfer += $output->writeFieldBegin('hasUnknownPartitions', TType::BOOL, 2);
      $xfer += $output->writeBool($this->hasUnknownPartitions);
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class PartitionsByExprRequest {
  static $_TSPEC;

  /**
   * @var string
   */
  public $dbName = null;
  /**
   * @var string
   */
  public $tblName = null;
  /**
   * @var string
   */
  public $expr = null;
  /**
   * @var string
   */
  public $defaultPartitionName = null;
  /**
   * @var int
   */
  public $maxParts = -1;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'dbName',
          'type' => TType::STRING,
          ),
        2 => array(
          'var' => 'tblName',
          'type' => TType::STRING,
          ),
        3 => array(
          'var' => 'expr',
          'type' => TType::STRING,
          ),
        4 => array(
          'var' => 'defaultPartitionName',
          'type' => TType::STRING,
          ),
        5 => array(
          'var' => 'maxParts',
          'type' => TType::I16,
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['dbName'])) {
        $this->dbName = $vals['dbName'];
      }
      if (isset($vals['tblName'])) {
        $this->tblName = $vals['tblName'];
      }
      if (isset($vals['expr'])) {
        $this->expr = $vals['expr'];
      }
      if (isset($vals['defaultPartitionName'])) {
        $this->defaultPartitionName = $vals['defaultPartitionName'];
      }
      if (isset($vals['maxParts'])) {
        $this->maxParts = $vals['maxParts'];
      }
    }
  }

  public function getName() {
    return 'PartitionsByExprRequest';
  }

  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->dbName);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 2:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->tblName);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 3:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->expr);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 4:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->defaultPartitionName);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 5:
          if ($ftype == TType::I16) {
            $xfer += $input->readI16($this->maxParts);
          } 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('PartitionsByExprRequest');
    if ($this->dbName !== null) {
      $xfer += $output->writeFieldBegin('dbName', TType::STRING, 1);
      $xfer += $output->writeString($this->dbName);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->tblName !== null) {
      $xfer += $output->writeFieldBegin('tblName', TType::STRING, 2);
      $xfer += $output->writeString($this->tblName);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->expr !== null) {
      $xfer += $output->writeFieldBegin('expr', TType::STRING, 3);
      $xfer += $output->writeString($this->expr);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->defaultPartitionName !== null) {
      $xfer += $output->writeFieldBegin('defaultPartitionName', TType::STRING, 4);
      $xfer += $output->writeString($this->defaultPartitionName);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->maxParts !== null) {
      $xfer += $output->writeFieldBegin('maxParts', TType::I16, 5);
      $xfer += $output->writeI16($this->maxParts);
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class TableStatsResult {
  static $_TSPEC;

  /**
   * @var \metastore\ColumnStatisticsObj[]
   */
  public $tableStats = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'tableStats',
          'type' => TType::LST,
          'etype' => TType::STRUCT,
          'elem' => array(
            'type' => TType::STRUCT,
            'class' => '\metastore\ColumnStatisticsObj',
            ),
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['tableStats'])) {
        $this->tableStats = $vals['tableStats'];
      }
    }
  }

  public function getName() {
    return 'TableStatsResult';
  }

  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->tableStats = array();
            $_size320 = 0;
            $_etype323 = 0;
            $xfer += $input->readListBegin($_etype323, $_size320);
            for ($_i324 = 0; $_i324 < $_size320; ++$_i324)
            {
              $elem325 = null;
              $elem325 = new \metastore\ColumnStatisticsObj();
              $xfer += $elem325->read($input);
              $this->tableStats []= $elem325;
            }
            $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('TableStatsResult');
    if ($this->tableStats !== null) {
      if (!is_array($this->tableStats)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('tableStats', TType::LST, 1);
      {
        $output->writeListBegin(TType::STRUCT, count($this->tableStats));
        {
          foreach ($this->tableStats as $iter326)
          {
            $xfer += $iter326->write($output);
          }
        }
        $output->writeListEnd();
      }
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class PartitionsStatsResult {
  static $_TSPEC;

  /**
   * @var array
   */
  public $partStats = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'partStats',
          'type' => TType::MAP,
          'ktype' => TType::STRING,
          'vtype' => TType::LST,
          'key' => array(
            'type' => TType::STRING,
          ),
          'val' => array(
            'type' => TType::LST,
            'etype' => TType::STRUCT,
            'elem' => array(
              'type' => TType::STRUCT,
              'class' => '\metastore\ColumnStatisticsObj',
              ),
            ),
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['partStats'])) {
        $this->partStats = $vals['partStats'];
      }
    }
  }

  public function getName() {
    return 'PartitionsStatsResult';
  }

  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::MAP) {
            $this->partStats = array();
            $_size327 = 0;
            $_ktype328 = 0;
            $_vtype329 = 0;
            $xfer += $input->readMapBegin($_ktype328, $_vtype329, $_size327);
            for ($_i331 = 0; $_i331 < $_size327; ++$_i331)
            {
              $key332 = '';
              $val333 = array();
              $xfer += $input->readString($key332);
              $val333 = array();
              $_size334 = 0;
              $_etype337 = 0;
              $xfer += $input->readListBegin($_etype337, $_size334);
              for ($_i338 = 0; $_i338 < $_size334; ++$_i338)
              {
                $elem339 = null;
                $elem339 = new \metastore\ColumnStatisticsObj();
                $xfer += $elem339->read($input);
                $val333 []= $elem339;
              }
              $xfer += $input->readListEnd();
              $this->partStats[$key332] = $val333;
            }
            $xfer += $input->readMapEnd();
          } 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('PartitionsStatsResult');
    if ($this->partStats !== null) {
      if (!is_array($this->partStats)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('partStats', TType::MAP, 1);
      {
        $output->writeMapBegin(TType::STRING, TType::LST, count($this->partStats));
        {
          foreach ($this->partStats as $kiter340 => $viter341)
          {
            $xfer += $output->writeString($kiter340);
            {
              $output->writeListBegin(TType::STRUCT, count($viter341));
              {
                foreach ($viter341 as $iter342)
                {
                  $xfer += $iter342->write($output);
                }
              }
              $output->writeListEnd();
            }
          }
        }
        $output->writeMapEnd();
      }
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class TableStatsRequest {
  static $_TSPEC;

  /**
   * @var string
   */
  public $dbName = null;
  /**
   * @var string
   */
  public $tblName = null;
  /**
   * @var string[]
   */
  public $colNames = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'dbName',
          'type' => TType::STRING,
          ),
        2 => array(
          'var' => 'tblName',
          'type' => TType::STRING,
          ),
        3 => array(
          'var' => 'colNames',
          'type' => TType::LST,
          'etype' => TType::STRING,
          'elem' => array(
            'type' => TType::STRING,
            ),
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['dbName'])) {
        $this->dbName = $vals['dbName'];
      }
      if (isset($vals['tblName'])) {
        $this->tblName = $vals['tblName'];
      }
      if (isset($vals['colNames'])) {
        $this->colNames = $vals['colNames'];
      }
    }
  }

  public function getName() {
    return 'TableStatsRequest';
  }

  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->dbName);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 2:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->tblName);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 3:
          if ($ftype == TType::LST) {
            $this->colNames = array();
            $_size343 = 0;
            $_etype346 = 0;
            $xfer += $input->readListBegin($_etype346, $_size343);
            for ($_i347 = 0; $_i347 < $_size343; ++$_i347)
            {
              $elem348 = null;
              $xfer += $input->readString($elem348);
              $this->colNames []= $elem348;
            }
            $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('TableStatsRequest');
    if ($this->dbName !== null) {
      $xfer += $output->writeFieldBegin('dbName', TType::STRING, 1);
      $xfer += $output->writeString($this->dbName);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->tblName !== null) {
      $xfer += $output->writeFieldBegin('tblName', TType::STRING, 2);
      $xfer += $output->writeString($this->tblName);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->colNames !== null) {
      if (!is_array($this->colNames)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('colNames', TType::LST, 3);
      {
        $output->writeListBegin(TType::STRING, count($this->colNames));
        {
          foreach ($this->colNames as $iter349)
          {
            $xfer += $output->writeString($iter349);
          }
        }
        $output->writeListEnd();
      }
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class PartitionsStatsRequest {
  static $_TSPEC;

  /**
   * @var string
   */
  public $dbName = null;
  /**
   * @var string
   */
  public $tblName = null;
  /**
   * @var string[]
   */
  public $colNames = null;
  /**
   * @var string[]
   */
  public $partNames = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'dbName',
          'type' => TType::STRING,
          ),
        2 => array(
          'var' => 'tblName',
          'type' => TType::STRING,
          ),
        3 => array(
          'var' => 'colNames',
          'type' => TType::LST,
          'etype' => TType::STRING,
          'elem' => array(
            'type' => TType::STRING,
            ),
          ),
        4 => array(
          'var' => 'partNames',
          'type' => TType::LST,
          'etype' => TType::STRING,
          'elem' => array(
            'type' => TType::STRING,
            ),
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['dbName'])) {
        $this->dbName = $vals['dbName'];
      }
      if (isset($vals['tblName'])) {
        $this->tblName = $vals['tblName'];
      }
      if (isset($vals['colNames'])) {
        $this->colNames = $vals['colNames'];
      }
      if (isset($vals['partNames'])) {
        $this->partNames = $vals['partNames'];
      }
    }
  }

  public function getName() {
    return 'PartitionsStatsRequest';
  }

  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->dbName);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 2:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->tblName);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 3:
          if ($ftype == TType::LST) {
            $this->colNames = array();
            $_size350 = 0;
            $_etype353 = 0;
            $xfer += $input->readListBegin($_etype353, $_size350);
            for ($_i354 = 0; $_i354 < $_size350; ++$_i354)
            {
              $elem355 = null;
              $xfer += $input->readString($elem355);
              $this->colNames []= $elem355;
            }
            $xfer += $input->readListEnd();
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 4:
          if ($ftype == TType::LST) {
            $this->partNames = array();
            $_size356 = 0;
            $_etype359 = 0;
            $xfer += $input->readListBegin($_etype359, $_size356);
            for ($_i360 = 0; $_i360 < $_size356; ++$_i360)
            {
              $elem361 = null;
              $xfer += $input->readString($elem361);
              $this->partNames []= $elem361;
            }
            $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('PartitionsStatsRequest');
    if ($this->dbName !== null) {
      $xfer += $output->writeFieldBegin('dbName', TType::STRING, 1);
      $xfer += $output->writeString($this->dbName);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->tblName !== null) {
      $xfer += $output->writeFieldBegin('tblName', TType::STRING, 2);
      $xfer += $output->writeString($this->tblName);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->colNames !== null) {
      if (!is_array($this->colNames)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('colNames', TType::LST, 3);
      {
        $output->writeListBegin(TType::STRING, count($this->colNames));
        {
          foreach ($this->colNames as $iter362)
          {
            $xfer += $output->writeString($iter362);
          }
        }
        $output->writeListEnd();
      }
      $xfer += $output->writeFieldEnd();
    }
    if ($this->partNames !== null) {
      if (!is_array($this->partNames)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('partNames', TType::LST, 4);
      {
        $output->writeListBegin(TType::STRING, count($this->partNames));
        {
          foreach ($this->partNames as $iter363)
          {
            $xfer += $output->writeString($iter363);
          }
        }
        $output->writeListEnd();
      }
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class AddPartitionsResult {
  static $_TSPEC;

  /**
   * @var \metastore\Partition[]
   */
  public $partitions = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'partitions',
          'type' => TType::LST,
          'etype' => TType::STRUCT,
          'elem' => array(
            'type' => TType::STRUCT,
            'class' => '\metastore\Partition',
            ),
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['partitions'])) {
        $this->partitions = $vals['partitions'];
      }
    }
  }

  public function getName() {
    return 'AddPartitionsResult';
  }

  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->partitions = array();
            $_size364 = 0;
            $_etype367 = 0;
            $xfer += $input->readListBegin($_etype367, $_size364);
            for ($_i368 = 0; $_i368 < $_size364; ++$_i368)
            {
              $elem369 = null;
              $elem369 = new \metastore\Partition();
              $xfer += $elem369->read($input);
              $this->partitions []= $elem369;
            }
            $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('AddPartitionsResult');
    if ($this->partitions !== null) {
      if (!is_array($this->partitions)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('partitions', TType::LST, 1);
      {
        $output->writeListBegin(TType::STRUCT, count($this->partitions));
        {
          foreach ($this->partitions as $iter370)
          {
            $xfer += $iter370->write($output);
          }
        }
        $output->writeListEnd();
      }
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class AddPartitionsRequest {
  static $_TSPEC;

  /**
   * @var string
   */
  public $dbName = null;
  /**
   * @var string
   */
  public $tblName = null;
  /**
   * @var \metastore\Partition[]
   */
  public $parts = null;
  /**
   * @var bool
   */
  public $ifNotExists = null;
  /**
   * @var bool
   */
  public $needResult = true;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'dbName',
          'type' => TType::STRING,
          ),
        2 => array(
          'var' => 'tblName',
          'type' => TType::STRING,
          ),
        3 => array(
          'var' => 'parts',
          'type' => TType::LST,
          'etype' => TType::STRUCT,
          'elem' => array(
            'type' => TType::STRUCT,
            'class' => '\metastore\Partition',
            ),
          ),
        4 => array(
          'var' => 'ifNotExists',
          'type' => TType::BOOL,
          ),
        5 => array(
          'var' => 'needResult',
          'type' => TType::BOOL,
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['dbName'])) {
        $this->dbName = $vals['dbName'];
      }
      if (isset($vals['tblName'])) {
        $this->tblName = $vals['tblName'];
      }
      if (isset($vals['parts'])) {
        $this->parts = $vals['parts'];
      }
      if (isset($vals['ifNotExists'])) {
        $this->ifNotExists = $vals['ifNotExists'];
      }
      if (isset($vals['needResult'])) {
        $this->needResult = $vals['needResult'];
      }
    }
  }

  public function getName() {
    return 'AddPartitionsRequest';
  }

  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->dbName);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 2:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->tblName);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 3:
          if ($ftype == TType::LST) {
            $this->parts = array();
            $_size371 = 0;
            $_etype374 = 0;
            $xfer += $input->readListBegin($_etype374, $_size371);
            for ($_i375 = 0; $_i375 < $_size371; ++$_i375)
            {
              $elem376 = null;
              $elem376 = new \metastore\Partition();
              $xfer += $elem376->read($input);
              $this->parts []= $elem376;
            }
            $xfer += $input->readListEnd();
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 4:
          if ($ftype == TType::BOOL) {
            $xfer += $input->readBool($this->ifNotExists);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 5:
          if ($ftype == TType::BOOL) {
            $xfer += $input->readBool($this->needResult);
          } 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('AddPartitionsRequest');
    if ($this->dbName !== null) {
      $xfer += $output->writeFieldBegin('dbName', TType::STRING, 1);
      $xfer += $output->writeString($this->dbName);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->tblName !== null) {
      $xfer += $output->writeFieldBegin('tblName', TType::STRING, 2);
      $xfer += $output->writeString($this->tblName);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->parts !== null) {
      if (!is_array($this->parts)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('parts', TType::LST, 3);
      {
        $output->writeListBegin(TType::STRUCT, count($this->parts));
        {
          foreach ($this->parts as $iter377)
          {
            $xfer += $iter377->write($output);
          }
        }
        $output->writeListEnd();
      }
      $xfer += $output->writeFieldEnd();
    }
    if ($this->ifNotExists !== null) {
      $xfer += $output->writeFieldBegin('ifNotExists', TType::BOOL, 4);
      $xfer += $output->writeBool($this->ifNotExists);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->needResult !== null) {
      $xfer += $output->writeFieldBegin('needResult', TType::BOOL, 5);
      $xfer += $output->writeBool($this->needResult);
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class DropPartitionsResult {
  static $_TSPEC;

  /**
   * @var \metastore\Partition[]
   */
  public $partitions = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'partitions',
          'type' => TType::LST,
          'etype' => TType::STRUCT,
          'elem' => array(
            'type' => TType::STRUCT,
            'class' => '\metastore\Partition',
            ),
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['partitions'])) {
        $this->partitions = $vals['partitions'];
      }
    }
  }

  public function getName() {
    return 'DropPartitionsResult';
  }

  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->partitions = array();
            $_size378 = 0;
            $_etype381 = 0;
            $xfer += $input->readListBegin($_etype381, $_size378);
            for ($_i382 = 0; $_i382 < $_size378; ++$_i382)
            {
              $elem383 = null;
              $elem383 = new \metastore\Partition();
              $xfer += $elem383->read($input);
              $this->partitions []= $elem383;
            }
            $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('DropPartitionsResult');
    if ($this->partitions !== null) {
      if (!is_array($this->partitions)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('partitions', TType::LST, 1);
      {
        $output->writeListBegin(TType::STRUCT, count($this->partitions));
        {
          foreach ($this->partitions as $iter384)
          {
            $xfer += $iter384->write($output);
          }
        }
        $output->writeListEnd();
      }
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class DropPartitionsExpr {
  static $_TSPEC;

  /**
   * @var string
   */
  public $expr = null;
  /**
   * @var int
   */
  public $partArchiveLevel = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'expr',
          'type' => TType::STRING,
          ),
        2 => array(
          'var' => 'partArchiveLevel',
          'type' => TType::I32,
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['expr'])) {
        $this->expr = $vals['expr'];
      }
      if (isset($vals['partArchiveLevel'])) {
        $this->partArchiveLevel = $vals['partArchiveLevel'];
      }
    }
  }

  public function getName() {
    return 'DropPartitionsExpr';
  }

  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->expr);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 2:
          if ($ftype == TType::I32) {
            $xfer += $input->readI32($this->partArchiveLevel);
          } 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('DropPartitionsExpr');
    if ($this->expr !== null) {
      $xfer += $output->writeFieldBegin('expr', TType::STRING, 1);
      $xfer += $output->writeString($this->expr);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->partArchiveLevel !== null) {
      $xfer += $output->writeFieldBegin('partArchiveLevel', TType::I32, 2);
      $xfer += $output->writeI32($this->partArchiveLevel);
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class RequestPartsSpec {
  static $_TSPEC;

  /**
   * @var string[]
   */
  public $names = null;
  /**
   * @var \metastore\DropPartitionsExpr[]
   */
  public $exprs = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'names',
          'type' => TType::LST,
          'etype' => TType::STRING,
          'elem' => array(
            'type' => TType::STRING,
            ),
          ),
        2 => array(
          'var' => 'exprs',
          'type' => TType::LST,
          'etype' => TType::STRUCT,
          'elem' => array(
            'type' => TType::STRUCT,
            'class' => '\metastore\DropPartitionsExpr',
            ),
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['names'])) {
        $this->names = $vals['names'];
      }
      if (isset($vals['exprs'])) {
        $this->exprs = $vals['exprs'];
      }
    }
  }

  public function getName() {
    return 'RequestPartsSpec';
  }

  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->names = array();
            $_size385 = 0;
            $_etype388 = 0;
            $xfer += $input->readListBegin($_etype388, $_size385);
            for ($_i389 = 0; $_i389 < $_size385; ++$_i389)
            {
              $elem390 = null;
              $xfer += $input->readString($elem390);
              $this->names []= $elem390;
            }
            $xfer += $input->readListEnd();
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 2:
          if ($ftype == TType::LST) {
            $this->exprs = array();
            $_size391 = 0;
            $_etype394 = 0;
            $xfer += $input->readListBegin($_etype394, $_size391);
            for ($_i395 = 0; $_i395 < $_size391; ++$_i395)
            {
              $elem396 = null;
              $elem396 = new \metastore\DropPartitionsExpr();
              $xfer += $elem396->read($input);
              $this->exprs []= $elem396;
            }
            $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('RequestPartsSpec');
    if ($this->names !== null) {
      if (!is_array($this->names)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('names', TType::LST, 1);
      {
        $output->writeListBegin(TType::STRING, count($this->names));
        {
          foreach ($this->names as $iter397)
          {
            $xfer += $output->writeString($iter397);
          }
        }
        $output->writeListEnd();
      }
      $xfer += $output->writeFieldEnd();
    }
    if ($this->exprs !== null) {
      if (!is_array($this->exprs)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('exprs', TType::LST, 2);
      {
        $output->writeListBegin(TType::STRUCT, count($this->exprs));
        {
          foreach ($this->exprs as $iter398)
          {
            $xfer += $iter398->write($output);
          }
        }
        $output->writeListEnd();
      }
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class DropPartitionsRequest {
  static $_TSPEC;

  /**
   * @var string
   */
  public $dbName = null;
  /**
   * @var string
   */
  public $tblName = null;
  /**
   * @var \metastore\RequestPartsSpec
   */
  public $parts = null;
  /**
   * @var bool
   */
  public $deleteData = null;
  /**
   * @var bool
   */
  public $ifExists = true;
  /**
   * @var bool
   */
  public $ignoreProtection = null;
  /**
   * @var \metastore\EnvironmentContext
   */
  public $environmentContext = null;
  /**
   * @var bool
   */
  public $needResult = true;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'dbName',
          'type' => TType::STRING,
          ),
        2 => array(
          'var' => 'tblName',
          'type' => TType::STRING,
          ),
        3 => array(
          'var' => 'parts',
          'type' => TType::STRUCT,
          'class' => '\metastore\RequestPartsSpec',
          ),
        4 => array(
          'var' => 'deleteData',
          'type' => TType::BOOL,
          ),
        5 => array(
          'var' => 'ifExists',
          'type' => TType::BOOL,
          ),
        6 => array(
          'var' => 'ignoreProtection',
          'type' => TType::BOOL,
          ),
        7 => array(
          'var' => 'environmentContext',
          'type' => TType::STRUCT,
          'class' => '\metastore\EnvironmentContext',
          ),
        8 => array(
          'var' => 'needResult',
          'type' => TType::BOOL,
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['dbName'])) {
        $this->dbName = $vals['dbName'];
      }
      if (isset($vals['tblName'])) {
        $this->tblName = $vals['tblName'];
      }
      if (isset($vals['parts'])) {
        $this->parts = $vals['parts'];
      }
      if (isset($vals['deleteData'])) {
        $this->deleteData = $vals['deleteData'];
      }
      if (isset($vals['ifExists'])) {
        $this->ifExists = $vals['ifExists'];
      }
      if (isset($vals['ignoreProtection'])) {
        $this->ignoreProtection = $vals['ignoreProtection'];
      }
      if (isset($vals['environmentContext'])) {
        $this->environmentContext = $vals['environmentContext'];
      }
      if (isset($vals['needResult'])) {
        $this->needResult = $vals['needResult'];
      }
    }
  }

  public function getName() {
    return 'DropPartitionsRequest';
  }

  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->dbName);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 2:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->tblName);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 3:
          if ($ftype == TType::STRUCT) {
            $this->parts = new \metastore\RequestPartsSpec();
            $xfer += $this->parts->read($input);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 4:
          if ($ftype == TType::BOOL) {
            $xfer += $input->readBool($this->deleteData);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 5:
          if ($ftype == TType::BOOL) {
            $xfer += $input->readBool($this->ifExists);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 6:
          if ($ftype == TType::BOOL) {
            $xfer += $input->readBool($this->ignoreProtection);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 7:
          if ($ftype == TType::STRUCT) {
            $this->environmentContext = new \metastore\EnvironmentContext();
            $xfer += $this->environmentContext->read($input);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 8:
          if ($ftype == TType::BOOL) {
            $xfer += $input->readBool($this->needResult);
          } 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('DropPartitionsRequest');
    if ($this->dbName !== null) {
      $xfer += $output->writeFieldBegin('dbName', TType::STRING, 1);
      $xfer += $output->writeString($this->dbName);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->tblName !== null) {
      $xfer += $output->writeFieldBegin('tblName', TType::STRING, 2);
      $xfer += $output->writeString($this->tblName);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->parts !== null) {
      if (!is_object($this->parts)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('parts', TType::STRUCT, 3);
      $xfer += $this->parts->write($output);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->deleteData !== null) {
      $xfer += $output->writeFieldBegin('deleteData', TType::BOOL, 4);
      $xfer += $output->writeBool($this->deleteData);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->ifExists !== null) {
      $xfer += $output->writeFieldBegin('ifExists', TType::BOOL, 5);
      $xfer += $output->writeBool($this->ifExists);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->ignoreProtection !== null) {
      $xfer += $output->writeFieldBegin('ignoreProtection', TType::BOOL, 6);
      $xfer += $output->writeBool($this->ignoreProtection);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->environmentContext !== null) {
      if (!is_object($this->environmentContext)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('environmentContext', TType::STRUCT, 7);
      $xfer += $this->environmentContext->write($output);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->needResult !== null) {
      $xfer += $output->writeFieldBegin('needResult', TType::BOOL, 8);
      $xfer += $output->writeBool($this->needResult);
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class ResourceUri {
  static $_TSPEC;

  /**
   * @var int
   */
  public $resourceType = null;
  /**
   * @var string
   */
  public $uri = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'resourceType',
          'type' => TType::I32,
          ),
        2 => array(
          'var' => 'uri',
          'type' => TType::STRING,
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['resourceType'])) {
        $this->resourceType = $vals['resourceType'];
      }
      if (isset($vals['uri'])) {
        $this->uri = $vals['uri'];
      }
    }
  }

  public function getName() {
    return 'ResourceUri';
  }

  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->resourceType);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 2:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->uri);
          } 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('ResourceUri');
    if ($this->resourceType !== null) {
      $xfer += $output->writeFieldBegin('resourceType', TType::I32, 1);
      $xfer += $output->writeI32($this->resourceType);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->uri !== null) {
      $xfer += $output->writeFieldBegin('uri', TType::STRING, 2);
      $xfer += $output->writeString($this->uri);
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class Function {
  static $_TSPEC;

  /**
   * @var string
   */
  public $functionName = null;
  /**
   * @var string
   */
  public $dbName = null;
  /**
   * @var string
   */
  public $className = null;
  /**
   * @var string
   */
  public $ownerName = null;
  /**
   * @var int
   */
  public $ownerType = null;
  /**
   * @var int
   */
  public $createTime = null;
  /**
   * @var int
   */
  public $functionType = null;
  /**
   * @var \metastore\ResourceUri[]
   */
  public $resourceUris = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'functionName',
          'type' => TType::STRING,
          ),
        2 => array(
          'var' => 'dbName',
          'type' => TType::STRING,
          ),
        3 => array(
          'var' => 'className',
          'type' => TType::STRING,
          ),
        4 => array(
          'var' => 'ownerName',
          'type' => TType::STRING,
          ),
        5 => array(
          'var' => 'ownerType',
          'type' => TType::I32,
          ),
        6 => array(
          'var' => 'createTime',
          'type' => TType::I32,
          ),
        7 => array(
          'var' => 'functionType',
          'type' => TType::I32,
          ),
        8 => array(
          'var' => 'resourceUris',
          'type' => TType::LST,
          'etype' => TType::STRUCT,
          'elem' => array(
            'type' => TType::STRUCT,
            'class' => '\metastore\ResourceUri',
            ),
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['functionName'])) {
        $this->functionName = $vals['functionName'];
      }
      if (isset($vals['dbName'])) {
        $this->dbName = $vals['dbName'];
      }
      if (isset($vals['className'])) {
        $this->className = $vals['className'];
      }
      if (isset($vals['ownerName'])) {
        $this->ownerName = $vals['ownerName'];
      }
      if (isset($vals['ownerType'])) {
        $this->ownerType = $vals['ownerType'];
      }
      if (isset($vals['createTime'])) {
        $this->createTime = $vals['createTime'];
      }
      if (isset($vals['functionType'])) {
        $this->functionType = $vals['functionType'];
      }
      if (isset($vals['resourceUris'])) {
        $this->resourceUris = $vals['resourceUris'];
      }
    }
  }

  public function getName() {
    return 'Function';
  }

  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->functionName);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 2:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->dbName);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 3:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->className);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 4:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->ownerName);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 5:
          if ($ftype == TType::I32) {
            $xfer += $input->readI32($this->ownerType);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 6:
          if ($ftype == TType::I32) {
            $xfer += $input->readI32($this->createTime);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 7:
          if ($ftype == TType::I32) {
            $xfer += $input->readI32($this->functionType);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 8:
          if ($ftype == TType::LST) {
            $this->resourceUris = array();
            $_size399 = 0;
            $_etype402 = 0;
            $xfer += $input->readListBegin($_etype402, $_size399);
            for ($_i403 = 0; $_i403 < $_size399; ++$_i403)
            {
              $elem404 = null;
              $elem404 = new \metastore\ResourceUri();
              $xfer += $elem404->read($input);
              $this->resourceUris []= $elem404;
            }
            $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('Function');
    if ($this->functionName !== null) {
      $xfer += $output->writeFieldBegin('functionName', TType::STRING, 1);
      $xfer += $output->writeString($this->functionName);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->dbName !== null) {
      $xfer += $output->writeFieldBegin('dbName', TType::STRING, 2);
      $xfer += $output->writeString($this->dbName);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->className !== null) {
      $xfer += $output->writeFieldBegin('className', TType::STRING, 3);
      $xfer += $output->writeString($this->className);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->ownerName !== null) {
      $xfer += $output->writeFieldBegin('ownerName', TType::STRING, 4);
      $xfer += $output->writeString($this->ownerName);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->ownerType !== null) {
      $xfer += $output->writeFieldBegin('ownerType', TType::I32, 5);
      $xfer += $output->writeI32($this->ownerType);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->createTime !== null) {
      $xfer += $output->writeFieldBegin('createTime', TType::I32, 6);
      $xfer += $output->writeI32($this->createTime);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->functionType !== null) {
      $xfer += $output->writeFieldBegin('functionType', TType::I32, 7);
      $xfer += $output->writeI32($this->functionType);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->resourceUris !== null) {
      if (!is_array($this->resourceUris)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('resourceUris', TType::LST, 8);
      {
        $output->writeListBegin(TType::STRUCT, count($this->resourceUris));
        {
          foreach ($this->resourceUris as $iter405)
          {
            $xfer += $iter405->write($output);
          }
        }
        $output->writeListEnd();
      }
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class TxnInfo {
  static $_TSPEC;

  /**
   * @var int
   */
  public $id = null;
  /**
   * @var int
   */
  public $state = null;
  /**
   * @var string
   */
  public $user = null;
  /**
   * @var string
   */
  public $hostname = null;
  /**
   * @var string
   */
  public $agentInfo = "Unknown";
  /**
   * @var int
   */
  public $heartbeatCount = 0;
  /**
   * @var string
   */
  public $metaInfo = null;
  /**
   * @var int
   */
  public $startedTime = null;
  /**
   * @var int
   */
  public $lastHeartbeatTime = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'id',
          'type' => TType::I64,
          ),
        2 => array(
          'var' => 'state',
          'type' => TType::I32,
          ),
        3 => array(
          'var' => 'user',
          'type' => TType::STRING,
          ),
        4 => array(
          'var' => 'hostname',
          'type' => TType::STRING,
          ),
        5 => array(
          'var' => 'agentInfo',
          'type' => TType::STRING,
          ),
        6 => array(
          'var' => 'heartbeatCount',
          'type' => TType::I32,
          ),
        7 => array(
          'var' => 'metaInfo',
          'type' => TType::STRING,
          ),
        8 => array(
          'var' => 'startedTime',
          'type' => TType::I64,
          ),
        9 => array(
          'var' => 'lastHeartbeatTime',
          'type' => TType::I64,
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['id'])) {
        $this->id = $vals['id'];
      }
      if (isset($vals['state'])) {
        $this->state = $vals['state'];
      }
      if (isset($vals['user'])) {
        $this->user = $vals['user'];
      }
      if (isset($vals['hostname'])) {
        $this->hostname = $vals['hostname'];
      }
      if (isset($vals['agentInfo'])) {
        $this->agentInfo = $vals['agentInfo'];
      }
      if (isset($vals['heartbeatCount'])) {
        $this->heartbeatCount = $vals['heartbeatCount'];
      }
      if (isset($vals['metaInfo'])) {
        $this->metaInfo = $vals['metaInfo'];
      }
      if (isset($vals['startedTime'])) {
        $this->startedTime = $vals['startedTime'];
      }
      if (isset($vals['lastHeartbeatTime'])) {
        $this->lastHeartbeatTime = $vals['lastHeartbeatTime'];
      }
    }
  }

  public function getName() {
    return 'TxnInfo';
  }

  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::I64) {
            $xfer += $input->readI64($this->id);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 2:
          if ($ftype == TType::I32) {
            $xfer += $input->readI32($this->state);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 3:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->user);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 4:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->hostname);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 5:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->agentInfo);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 6:
          if ($ftype == TType::I32) {
            $xfer += $input->readI32($this->heartbeatCount);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 7:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->metaInfo);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 8:
          if ($ftype == TType::I64) {
            $xfer += $input->readI64($this->startedTime);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 9:
          if ($ftype == TType::I64) {
            $xfer += $input->readI64($this->lastHeartbeatTime);
          } 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('TxnInfo');
    if ($this->id !== null) {
      $xfer += $output->writeFieldBegin('id', TType::I64, 1);
      $xfer += $output->writeI64($this->id);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->state !== null) {
      $xfer += $output->writeFieldBegin('state', TType::I32, 2);
      $xfer += $output->writeI32($this->state);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->user !== null) {
      $xfer += $output->writeFieldBegin('user', TType::STRING, 3);
      $xfer += $output->writeString($this->user);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->hostname !== null) {
      $xfer += $output->writeFieldBegin('hostname', TType::STRING, 4);
      $xfer += $output->writeString($this->hostname);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->agentInfo !== null) {
      $xfer += $output->writeFieldBegin('agentInfo', TType::STRING, 5);
      $xfer += $output->writeString($this->agentInfo);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->heartbeatCount !== null) {
      $xfer += $output->writeFieldBegin('heartbeatCount', TType::I32, 6);
      $xfer += $output->writeI32($this->heartbeatCount);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->metaInfo !== null) {
      $xfer += $output->writeFieldBegin('metaInfo', TType::STRING, 7);
      $xfer += $output->writeString($this->metaInfo);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->startedTime !== null) {
      $xfer += $output->writeFieldBegin('startedTime', TType::I64, 8);
      $xfer += $output->writeI64($this->startedTime);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->lastHeartbeatTime !== null) {
      $xfer += $output->writeFieldBegin('lastHeartbeatTime', TType::I64, 9);
      $xfer += $output->writeI64($this->lastHeartbeatTime);
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class GetOpenTxnsInfoResponse {
  static $_TSPEC;

  /**
   * @var int
   */
  public $txn_high_water_mark = null;
  /**
   * @var \metastore\TxnInfo[]
   */
  public $open_txns = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'txn_high_water_mark',
          'type' => TType::I64,
          ),
        2 => array(
          'var' => 'open_txns',
          'type' => TType::LST,
          'etype' => TType::STRUCT,
          'elem' => array(
            'type' => TType::STRUCT,
            'class' => '\metastore\TxnInfo',
            ),
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['txn_high_water_mark'])) {
        $this->txn_high_water_mark = $vals['txn_high_water_mark'];
      }
      if (isset($vals['open_txns'])) {
        $this->open_txns = $vals['open_txns'];
      }
    }
  }

  public function getName() {
    return 'GetOpenTxnsInfoResponse';
  }

  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::I64) {
            $xfer += $input->readI64($this->txn_high_water_mark);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 2:
          if ($ftype == TType::LST) {
            $this->open_txns = array();
            $_size406 = 0;
            $_etype409 = 0;
            $xfer += $input->readListBegin($_etype409, $_size406);
            for ($_i410 = 0; $_i410 < $_size406; ++$_i410)
            {
              $elem411 = null;
              $elem411 = new \metastore\TxnInfo();
              $xfer += $elem411->read($input);
              $this->open_txns []= $elem411;
            }
            $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('GetOpenTxnsInfoResponse');
    if ($this->txn_high_water_mark !== null) {
      $xfer += $output->writeFieldBegin('txn_high_water_mark', TType::I64, 1);
      $xfer += $output->writeI64($this->txn_high_water_mark);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->open_txns !== null) {
      if (!is_array($this->open_txns)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('open_txns', TType::LST, 2);
      {
        $output->writeListBegin(TType::STRUCT, count($this->open_txns));
        {
          foreach ($this->open_txns as $iter412)
          {
            $xfer += $iter412->write($output);
          }
        }
        $output->writeListEnd();
      }
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class GetOpenTxnsResponse {
  static $_TSPEC;

  /**
   * @var int
   */
  public $txn_high_water_mark = null;
  /**
   * @var int[]
   */
  public $open_txns = null;
  /**
   * @var int
   */
  public $min_open_txn = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'txn_high_water_mark',
          'type' => TType::I64,
          ),
        2 => array(
          'var' => 'open_txns',
          'type' => TType::SET,
          'etype' => TType::I64,
          'elem' => array(
            'type' => TType::I64,
            ),
          ),
        3 => array(
          'var' => 'min_open_txn',
          'type' => TType::I64,
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['txn_high_water_mark'])) {
        $this->txn_high_water_mark = $vals['txn_high_water_mark'];
      }
      if (isset($vals['open_txns'])) {
        $this->open_txns = $vals['open_txns'];
      }
      if (isset($vals['min_open_txn'])) {
        $this->min_open_txn = $vals['min_open_txn'];
      }
    }
  }

  public function getName() {
    return 'GetOpenTxnsResponse';
  }

  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::I64) {
            $xfer += $input->readI64($this->txn_high_water_mark);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 2:
          if ($ftype == TType::SET) {
            $this->open_txns = array();
            $_size413 = 0;
            $_etype416 = 0;
            $xfer += $input->readSetBegin($_etype416, $_size413);
            for ($_i417 = 0; $_i417 < $_size413; ++$_i417)
            {
              $elem418 = null;
              $xfer += $input->readI64($elem418);
              if (is_scalar($elem418)) {
                $this->open_txns[$elem418] = true;
              } else {
                $this->open_txns []= $elem418;
              }
            }
            $xfer += $input->readSetEnd();
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 3:
          if ($ftype == TType::I64) {
            $xfer += $input->readI64($this->min_open_txn);
          } 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('GetOpenTxnsResponse');
    if ($this->txn_high_water_mark !== null) {
      $xfer += $output->writeFieldBegin('txn_high_water_mark', TType::I64, 1);
      $xfer += $output->writeI64($this->txn_high_water_mark);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->open_txns !== null) {
      if (!is_array($this->open_txns)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('open_txns', TType::SET, 2);
      {
        $output->writeSetBegin(TType::I64, count($this->open_txns));
        {
          foreach ($this->open_txns as $iter419 => $iter420)
          {
            if (is_scalar($iter420)) {
            $xfer += $output->writeI64($iter419);
            } else {
            $xfer += $output->writeI64($iter420);
            }
          }
        }
        $output->writeSetEnd();
      }
      $xfer += $output->writeFieldEnd();
    }
    if ($this->min_open_txn !== null) {
      $xfer += $output->writeFieldBegin('min_open_txn', TType::I64, 3);
      $xfer += $output->writeI64($this->min_open_txn);
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class OpenTxnRequest {
  static $_TSPEC;

  /**
   * @var int
   */
  public $num_txns = null;
  /**
   * @var string
   */
  public $user = null;
  /**
   * @var string
   */
  public $hostname = null;
  /**
   * @var string
   */
  public $agentInfo = "Unknown";

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'num_txns',
          'type' => TType::I32,
          ),
        2 => array(
          'var' => 'user',
          'type' => TType::STRING,
          ),
        3 => array(
          'var' => 'hostname',
          'type' => TType::STRING,
          ),
        4 => array(
          'var' => 'agentInfo',
          'type' => TType::STRING,
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['num_txns'])) {
        $this->num_txns = $vals['num_txns'];
      }
      if (isset($vals['user'])) {
        $this->user = $vals['user'];
      }
      if (isset($vals['hostname'])) {
        $this->hostname = $vals['hostname'];
      }
      if (isset($vals['agentInfo'])) {
        $this->agentInfo = $vals['agentInfo'];
      }
    }
  }

  public function getName() {
    return 'OpenTxnRequest';
  }

  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->num_txns);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 2:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->user);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 3:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->hostname);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 4:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->agentInfo);
          } 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('OpenTxnRequest');
    if ($this->num_txns !== null) {
      $xfer += $output->writeFieldBegin('num_txns', TType::I32, 1);
      $xfer += $output->writeI32($this->num_txns);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->user !== null) {
      $xfer += $output->writeFieldBegin('user', TType::STRING, 2);
      $xfer += $output->writeString($this->user);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->hostname !== null) {
      $xfer += $output->writeFieldBegin('hostname', TType::STRING, 3);
      $xfer += $output->writeString($this->hostname);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->agentInfo !== null) {
      $xfer += $output->writeFieldBegin('agentInfo', TType::STRING, 4);
      $xfer += $output->writeString($this->agentInfo);
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class OpenTxnsResponse {
  static $_TSPEC;

  /**
   * @var int[]
   */
  public $txn_ids = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'txn_ids',
          'type' => TType::LST,
          'etype' => TType::I64,
          'elem' => array(
            'type' => TType::I64,
            ),
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['txn_ids'])) {
        $this->txn_ids = $vals['txn_ids'];
      }
    }
  }

  public function getName() {
    return 'OpenTxnsResponse';
  }

  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->txn_ids = array();
            $_size421 = 0;
            $_etype424 = 0;
            $xfer += $input->readListBegin($_etype424, $_size421);
            for ($_i425 = 0; $_i425 < $_size421; ++$_i425)
            {
              $elem426 = null;
              $xfer += $input->readI64($elem426);
              $this->txn_ids []= $elem426;
            }
            $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('OpenTxnsResponse');
    if ($this->txn_ids !== null) {
      if (!is_array($this->txn_ids)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('txn_ids', TType::LST, 1);
      {
        $output->writeListBegin(TType::I64, count($this->txn_ids));
        {
          foreach ($this->txn_ids as $iter427)
          {
            $xfer += $output->writeI64($iter427);
          }
        }
        $output->writeListEnd();
      }
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class AbortTxnRequest {
  static $_TSPEC;

  /**
   * @var int
   */
  public $txnid = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'txnid',
          'type' => TType::I64,
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['txnid'])) {
        $this->txnid = $vals['txnid'];
      }
    }
  }

  public function getName() {
    return 'AbortTxnRequest';
  }

  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::I64) {
            $xfer += $input->readI64($this->txnid);
          } 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('AbortTxnRequest');
    if ($this->txnid !== null) {
      $xfer += $output->writeFieldBegin('txnid', TType::I64, 1);
      $xfer += $output->writeI64($this->txnid);
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class AbortTxnsRequest {
  static $_TSPEC;

  /**
   * @var int[]
   */
  public $txn_ids = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'txn_ids',
          'type' => TType::LST,
          'etype' => TType::I64,
          'elem' => array(
            'type' => TType::I64,
            ),
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['txn_ids'])) {
        $this->txn_ids = $vals['txn_ids'];
      }
    }
  }

  public function getName() {
    return 'AbortTxnsRequest';
  }

  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->txn_ids = array();
            $_size428 = 0;
            $_etype431 = 0;
            $xfer += $input->readListBegin($_etype431, $_size428);
            for ($_i432 = 0; $_i432 < $_size428; ++$_i432)
            {
              $elem433 = null;
              $xfer += $input->readI64($elem433);
              $this->txn_ids []= $elem433;
            }
            $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('AbortTxnsRequest');
    if ($this->txn_ids !== null) {
      if (!is_array($this->txn_ids)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('txn_ids', TType::LST, 1);
      {
        $output->writeListBegin(TType::I64, count($this->txn_ids));
        {
          foreach ($this->txn_ids as $iter434)
          {
            $xfer += $output->writeI64($iter434);
          }
        }
        $output->writeListEnd();
      }
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class CommitTxnRequest {
  static $_TSPEC;

  /**
   * @var int
   */
  public $txnid = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'txnid',
          'type' => TType::I64,
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['txnid'])) {
        $this->txnid = $vals['txnid'];
      }
    }
  }

  public function getName() {
    return 'CommitTxnRequest';
  }

  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::I64) {
            $xfer += $input->readI64($this->txnid);
          } 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('CommitTxnRequest');
    if ($this->txnid !== null) {
      $xfer += $output->writeFieldBegin('txnid', TType::I64, 1);
      $xfer += $output->writeI64($this->txnid);
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class LockComponent {
  static $_TSPEC;

  /**
   * @var int
   */
  public $type = null;
  /**
   * @var int
   */
  public $level = null;
  /**
   * @var string
   */
  public $dbname = null;
  /**
   * @var string
   */
  public $tablename = null;
  /**
   * @var string
   */
  public $partitionname = null;
  /**
   * @var int
   */
  public $operationType =   5;
  /**
   * @var bool
   */
  public $isAcid = false;
  /**
   * @var bool
   */
  public $isDynamicPartitionWrite = false;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'type',
          'type' => TType::I32,
          ),
        2 => array(
          'var' => 'level',
          'type' => TType::I32,
          ),
        3 => array(
          'var' => 'dbname',
          'type' => TType::STRING,
          ),
        4 => array(
          'var' => 'tablename',
          'type' => TType::STRING,
          ),
        5 => array(
          'var' => 'partitionname',
          'type' => TType::STRING,
          ),
        6 => array(
          'var' => 'operationType',
          'type' => TType::I32,
          ),
        7 => array(
          'var' => 'isAcid',
          'type' => TType::BOOL,
          ),
        8 => array(
          'var' => 'isDynamicPartitionWrite',
          'type' => TType::BOOL,
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['type'])) {
        $this->type = $vals['type'];
      }
      if (isset($vals['level'])) {
        $this->level = $vals['level'];
      }
      if (isset($vals['dbname'])) {
        $this->dbname = $vals['dbname'];
      }
      if (isset($vals['tablename'])) {
        $this->tablename = $vals['tablename'];
      }
      if (isset($vals['partitionname'])) {
        $this->partitionname = $vals['partitionname'];
      }
      if (isset($vals['operationType'])) {
        $this->operationType = $vals['operationType'];
      }
      if (isset($vals['isAcid'])) {
        $this->isAcid = $vals['isAcid'];
      }
      if (isset($vals['isDynamicPartitionWrite'])) {
        $this->isDynamicPartitionWrite = $vals['isDynamicPartitionWrite'];
      }
    }
  }

  public function getName() {
    return 'LockComponent';
  }

  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->type);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 2:
          if ($ftype == TType::I32) {
            $xfer += $input->readI32($this->level);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 3:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->dbname);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 4:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->tablename);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 5:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->partitionname);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 6:
          if ($ftype == TType::I32) {
            $xfer += $input->readI32($this->operationType);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 7:
          if ($ftype == TType::BOOL) {
            $xfer += $input->readBool($this->isAcid);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 8:
          if ($ftype == TType::BOOL) {
            $xfer += $input->readBool($this->isDynamicPartitionWrite);
          } 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('LockComponent');
    if ($this->type !== null) {
      $xfer += $output->writeFieldBegin('type', TType::I32, 1);
      $xfer += $output->writeI32($this->type);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->level !== null) {
      $xfer += $output->writeFieldBegin('level', TType::I32, 2);
      $xfer += $output->writeI32($this->level);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->dbname !== null) {
      $xfer += $output->writeFieldBegin('dbname', TType::STRING, 3);
      $xfer += $output->writeString($this->dbname);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->tablename !== null) {
      $xfer += $output->writeFieldBegin('tablename', TType::STRING, 4);
      $xfer += $output->writeString($this->tablename);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->partitionname !== null) {
      $xfer += $output->writeFieldBegin('partitionname', TType::STRING, 5);
      $xfer += $output->writeString($this->partitionname);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->operationType !== null) {
      $xfer += $output->writeFieldBegin('operationType', TType::I32, 6);
      $xfer += $output->writeI32($this->operationType);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->isAcid !== null) {
      $xfer += $output->writeFieldBegin('isAcid', TType::BOOL, 7);
      $xfer += $output->writeBool($this->isAcid);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->isDynamicPartitionWrite !== null) {
      $xfer += $output->writeFieldBegin('isDynamicPartitionWrite', TType::BOOL, 8);
      $xfer += $output->writeBool($this->isDynamicPartitionWrite);
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class LockRequest {
  static $_TSPEC;

  /**
   * @var \metastore\LockComponent[]
   */
  public $component = null;
  /**
   * @var int
   */
  public $txnid = null;
  /**
   * @var string
   */
  public $user = null;
  /**
   * @var string
   */
  public $hostname = null;
  /**
   * @var string
   */
  public $agentInfo = "Unknown";

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'component',
          'type' => TType::LST,
          'etype' => TType::STRUCT,
          'elem' => array(
            'type' => TType::STRUCT,
            'class' => '\metastore\LockComponent',
            ),
          ),
        2 => array(
          'var' => 'txnid',
          'type' => TType::I64,
          ),
        3 => array(
          'var' => 'user',
          'type' => TType::STRING,
          ),
        4 => array(
          'var' => 'hostname',
          'type' => TType::STRING,
          ),
        5 => array(
          'var' => 'agentInfo',
          'type' => TType::STRING,
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['component'])) {
        $this->component = $vals['component'];
      }
      if (isset($vals['txnid'])) {
        $this->txnid = $vals['txnid'];
      }
      if (isset($vals['user'])) {
        $this->user = $vals['user'];
      }
      if (isset($vals['hostname'])) {
        $this->hostname = $vals['hostname'];
      }
      if (isset($vals['agentInfo'])) {
        $this->agentInfo = $vals['agentInfo'];
      }
    }
  }

  public function getName() {
    return 'LockRequest';
  }

  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->component = array();
            $_size435 = 0;
            $_etype438 = 0;
            $xfer += $input->readListBegin($_etype438, $_size435);
            for ($_i439 = 0; $_i439 < $_size435; ++$_i439)
            {
              $elem440 = null;
              $elem440 = new \metastore\LockComponent();
              $xfer += $elem440->read($input);
              $this->component []= $elem440;
            }
            $xfer += $input->readListEnd();
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 2:
          if ($ftype == TType::I64) {
            $xfer += $input->readI64($this->txnid);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 3:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->user);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 4:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->hostname);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 5:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->agentInfo);
          } 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('LockRequest');
    if ($this->component !== null) {
      if (!is_array($this->component)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('component', TType::LST, 1);
      {
        $output->writeListBegin(TType::STRUCT, count($this->component));
        {
          foreach ($this->component as $iter441)
          {
            $xfer += $iter441->write($output);
          }
        }
        $output->writeListEnd();
      }
      $xfer += $output->writeFieldEnd();
    }
    if ($this->txnid !== null) {
      $xfer += $output->writeFieldBegin('txnid', TType::I64, 2);
      $xfer += $output->writeI64($this->txnid);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->user !== null) {
      $xfer += $output->writeFieldBegin('user', TType::STRING, 3);
      $xfer += $output->writeString($this->user);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->hostname !== null) {
      $xfer += $output->writeFieldBegin('hostname', TType::STRING, 4);
      $xfer += $output->writeString($this->hostname);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->agentInfo !== null) {
      $xfer += $output->writeFieldBegin('agentInfo', TType::STRING, 5);
      $xfer += $output->writeString($this->agentInfo);
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class LockResponse {
  static $_TSPEC;

  /**
   * @var int
   */
  public $lockid = null;
  /**
   * @var int
   */
  public $state = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'lockid',
          'type' => TType::I64,
          ),
        2 => array(
          'var' => 'state',
          'type' => TType::I32,
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['lockid'])) {
        $this->lockid = $vals['lockid'];
      }
      if (isset($vals['state'])) {
        $this->state = $vals['state'];
      }
    }
  }

  public function getName() {
    return 'LockResponse';
  }

  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::I64) {
            $xfer += $input->readI64($this->lockid);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 2:
          if ($ftype == TType::I32) {
            $xfer += $input->readI32($this->state);
          } 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('LockResponse');
    if ($this->lockid !== null) {
      $xfer += $output->writeFieldBegin('lockid', TType::I64, 1);
      $xfer += $output->writeI64($this->lockid);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->state !== null) {
      $xfer += $output->writeFieldBegin('state', TType::I32, 2);
      $xfer += $output->writeI32($this->state);
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class CheckLockRequest {
  static $_TSPEC;

  /**
   * @var int
   */
  public $lockid = null;
  /**
   * @var int
   */
  public $txnid = null;
  /**
   * @var int
   */
  public $elapsed_ms = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'lockid',
          'type' => TType::I64,
          ),
        2 => array(
          'var' => 'txnid',
          'type' => TType::I64,
          ),
        3 => array(
          'var' => 'elapsed_ms',
          'type' => TType::I64,
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['lockid'])) {
        $this->lockid = $vals['lockid'];
      }
      if (isset($vals['txnid'])) {
        $this->txnid = $vals['txnid'];
      }
      if (isset($vals['elapsed_ms'])) {
        $this->elapsed_ms = $vals['elapsed_ms'];
      }
    }
  }

  public function getName() {
    return 'CheckLockRequest';
  }

  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::I64) {
            $xfer += $input->readI64($this->lockid);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 2:
          if ($ftype == TType::I64) {
            $xfer += $input->readI64($this->txnid);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 3:
          if ($ftype == TType::I64) {
            $xfer += $input->readI64($this->elapsed_ms);
          } 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('CheckLockRequest');
    if ($this->lockid !== null) {
      $xfer += $output->writeFieldBegin('lockid', TType::I64, 1);
      $xfer += $output->writeI64($this->lockid);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->txnid !== null) {
      $xfer += $output->writeFieldBegin('txnid', TType::I64, 2);
      $xfer += $output->writeI64($this->txnid);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->elapsed_ms !== null) {
      $xfer += $output->writeFieldBegin('elapsed_ms', TType::I64, 3);
      $xfer += $output->writeI64($this->elapsed_ms);
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class UnlockRequest {
  static $_TSPEC;

  /**
   * @var int
   */
  public $lockid = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'lockid',
          'type' => TType::I64,
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['lockid'])) {
        $this->lockid = $vals['lockid'];
      }
    }
  }

  public function getName() {
    return 'UnlockRequest';
  }

  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::I64) {
            $xfer += $input->readI64($this->lockid);
          } 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('UnlockRequest');
    if ($this->lockid !== null) {
      $xfer += $output->writeFieldBegin('lockid', TType::I64, 1);
      $xfer += $output->writeI64($this->lockid);
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class ShowLocksRequest {
  static $_TSPEC;

  /**
   * @var string
   */
  public $dbname = null;
  /**
   * @var string
   */
  public $tablename = null;
  /**
   * @var string
   */
  public $partname = null;
  /**
   * @var bool
   */
  public $isExtended = false;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'dbname',
          'type' => TType::STRING,
          ),
        2 => array(
          'var' => 'tablename',
          'type' => TType::STRING,
          ),
        3 => array(
          'var' => 'partname',
          'type' => TType::STRING,
          ),
        4 => array(
          'var' => 'isExtended',
          'type' => TType::BOOL,
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['dbname'])) {
        $this->dbname = $vals['dbname'];
      }
      if (isset($vals['tablename'])) {
        $this->tablename = $vals['tablename'];
      }
      if (isset($vals['partname'])) {
        $this->partname = $vals['partname'];
      }
      if (isset($vals['isExtended'])) {
        $this->isExtended = $vals['isExtended'];
      }
    }
  }

  public function getName() {
    return 'ShowLocksRequest';
  }

  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->dbname);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 2:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->tablename);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 3:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->partname);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 4:
          if ($ftype == TType::BOOL) {
            $xfer += $input->readBool($this->isExtended);
          } 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('ShowLocksRequest');
    if ($this->dbname !== null) {
      $xfer += $output->writeFieldBegin('dbname', TType::STRING, 1);
      $xfer += $output->writeString($this->dbname);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->tablename !== null) {
      $xfer += $output->writeFieldBegin('tablename', TType::STRING, 2);
      $xfer += $output->writeString($this->tablename);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->partname !== null) {
      $xfer += $output->writeFieldBegin('partname', TType::STRING, 3);
      $xfer += $output->writeString($this->partname);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->isExtended !== null) {
      $xfer += $output->writeFieldBegin('isExtended', TType::BOOL, 4);
      $xfer += $output->writeBool($this->isExtended);
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class ShowLocksResponseElement {
  static $_TSPEC;

  /**
   * @var int
   */
  public $lockid = null;
  /**
   * @var string
   */
  public $dbname = null;
  /**
   * @var string
   */
  public $tablename = null;
  /**
   * @var string
   */
  public $partname = null;
  /**
   * @var int
   */
  public $state = null;
  /**
   * @var int
   */
  public $type = null;
  /**
   * @var int
   */
  public $txnid = null;
  /**
   * @var int
   */
  public $lastheartbeat = null;
  /**
   * @var int
   */
  public $acquiredat = null;
  /**
   * @var string
   */
  public $user = null;
  /**
   * @var string
   */
  public $hostname = null;
  /**
   * @var int
   */
  public $heartbeatCount = 0;
  /**
   * @var string
   */
  public $agentInfo = null;
  /**
   * @var int
   */
  public $blockedByExtId = null;
  /**
   * @var int
   */
  public $blockedByIntId = null;
  /**
   * @var int
   */
  public $lockIdInternal = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'lockid',
          'type' => TType::I64,
          ),
        2 => array(
          'var' => 'dbname',
          'type' => TType::STRING,
          ),
        3 => array(
          'var' => 'tablename',
          'type' => TType::STRING,
          ),
        4 => array(
          'var' => 'partname',
          'type' => TType::STRING,
          ),
        5 => array(
          'var' => 'state',
          'type' => TType::I32,
          ),
        6 => array(
          'var' => 'type',
          'type' => TType::I32,
          ),
        7 => array(
          'var' => 'txnid',
          'type' => TType::I64,
          ),
        8 => array(
          'var' => 'lastheartbeat',
          'type' => TType::I64,
          ),
        9 => array(
          'var' => 'acquiredat',
          'type' => TType::I64,
          ),
        10 => array(
          'var' => 'user',
          'type' => TType::STRING,
          ),
        11 => array(
          'var' => 'hostname',
          'type' => TType::STRING,
          ),
        12 => array(
          'var' => 'heartbeatCount',
          'type' => TType::I32,
          ),
        13 => array(
          'var' => 'agentInfo',
          'type' => TType::STRING,
          ),
        14 => array(
          'var' => 'blockedByExtId',
          'type' => TType::I64,
          ),
        15 => array(
          'var' => 'blockedByIntId',
          'type' => TType::I64,
          ),
        16 => array(
          'var' => 'lockIdInternal',
          'type' => TType::I64,
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['lockid'])) {
        $this->lockid = $vals['lockid'];
      }
      if (isset($vals['dbname'])) {
        $this->dbname = $vals['dbname'];
      }
      if (isset($vals['tablename'])) {
        $this->tablename = $vals['tablename'];
      }
      if (isset($vals['partname'])) {
        $this->partname = $vals['partname'];
      }
      if (isset($vals['state'])) {
        $this->state = $vals['state'];
      }
      if (isset($vals['type'])) {
        $this->type = $vals['type'];
      }
      if (isset($vals['txnid'])) {
        $this->txnid = $vals['txnid'];
      }
      if (isset($vals['lastheartbeat'])) {
        $this->lastheartbeat = $vals['lastheartbeat'];
      }
      if (isset($vals['acquiredat'])) {
        $this->acquiredat = $vals['acquiredat'];
      }
      if (isset($vals['user'])) {
        $this->user = $vals['user'];
      }
      if (isset($vals['hostname'])) {
        $this->hostname = $vals['hostname'];
      }
      if (isset($vals['heartbeatCount'])) {
        $this->heartbeatCount = $vals['heartbeatCount'];
      }
      if (isset($vals['agentInfo'])) {
        $this->agentInfo = $vals['agentInfo'];
      }
      if (isset($vals['blockedByExtId'])) {
        $this->blockedByExtId = $vals['blockedByExtId'];
      }
      if (isset($vals['blockedByIntId'])) {
        $this->blockedByIntId = $vals['blockedByIntId'];
      }
      if (isset($vals['lockIdInternal'])) {
        $this->lockIdInternal = $vals['lockIdInternal'];
      }
    }
  }

  public function getName() {
    return 'ShowLocksResponseElement';
  }

  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::I64) {
            $xfer += $input->readI64($this->lockid);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 2:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->dbname);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 3:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->tablename);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 4:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->partname);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 5:
          if ($ftype == TType::I32) {
            $xfer += $input->readI32($this->state);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 6:
          if ($ftype == TType::I32) {
            $xfer += $input->readI32($this->type);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 7:
          if ($ftype == TType::I64) {
            $xfer += $input->readI64($this->txnid);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 8:
          if ($ftype == TType::I64) {
            $xfer += $input->readI64($this->lastheartbeat);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 9:
          if ($ftype == TType::I64) {
            $xfer += $input->readI64($this->acquiredat);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 10:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->user);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 11:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->hostname);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 12:
          if ($ftype == TType::I32) {
            $xfer += $input->readI32($this->heartbeatCount);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 13:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->agentInfo);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 14:
          if ($ftype == TType::I64) {
            $xfer += $input->readI64($this->blockedByExtId);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 15:
          if ($ftype == TType::I64) {
            $xfer += $input->readI64($this->blockedByIntId);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 16:
          if ($ftype == TType::I64) {
            $xfer += $input->readI64($this->lockIdInternal);
          } 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('ShowLocksResponseElement');
    if ($this->lockid !== null) {
      $xfer += $output->writeFieldBegin('lockid', TType::I64, 1);
      $xfer += $output->writeI64($this->lockid);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->dbname !== null) {
      $xfer += $output->writeFieldBegin('dbname', TType::STRING, 2);
      $xfer += $output->writeString($this->dbname);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->tablename !== null) {
      $xfer += $output->writeFieldBegin('tablename', TType::STRING, 3);
      $xfer += $output->writeString($this->tablename);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->partname !== null) {
      $xfer += $output->writeFieldBegin('partname', TType::STRING, 4);
      $xfer += $output->writeString($this->partname);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->state !== null) {
      $xfer += $output->writeFieldBegin('state', TType::I32, 5);
      $xfer += $output->writeI32($this->state);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->type !== null) {
      $xfer += $output->writeFieldBegin('type', TType::I32, 6);
      $xfer += $output->writeI32($this->type);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->txnid !== null) {
      $xfer += $output->writeFieldBegin('txnid', TType::I64, 7);
      $xfer += $output->writeI64($this->txnid);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->lastheartbeat !== null) {
      $xfer += $output->writeFieldBegin('lastheartbeat', TType::I64, 8);
      $xfer += $output->writeI64($this->lastheartbeat);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->acquiredat !== null) {
      $xfer += $output->writeFieldBegin('acquiredat', TType::I64, 9);
      $xfer += $output->writeI64($this->acquiredat);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->user !== null) {
      $xfer += $output->writeFieldBegin('user', TType::STRING, 10);
      $xfer += $output->writeString($this->user);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->hostname !== null) {
      $xfer += $output->writeFieldBegin('hostname', TType::STRING, 11);
      $xfer += $output->writeString($this->hostname);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->heartbeatCount !== null) {
      $xfer += $output->writeFieldBegin('heartbeatCount', TType::I32, 12);
      $xfer += $output->writeI32($this->heartbeatCount);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->agentInfo !== null) {
      $xfer += $output->writeFieldBegin('agentInfo', TType::STRING, 13);
      $xfer += $output->writeString($this->agentInfo);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->blockedByExtId !== null) {
      $xfer += $output->writeFieldBegin('blockedByExtId', TType::I64, 14);
      $xfer += $output->writeI64($this->blockedByExtId);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->blockedByIntId !== null) {
      $xfer += $output->writeFieldBegin('blockedByIntId', TType::I64, 15);
      $xfer += $output->writeI64($this->blockedByIntId);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->lockIdInternal !== null) {
      $xfer += $output->writeFieldBegin('lockIdInternal', TType::I64, 16);
      $xfer += $output->writeI64($this->lockIdInternal);
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class ShowLocksResponse {
  static $_TSPEC;

  /**
   * @var \metastore\ShowLocksResponseElement[]
   */
  public $locks = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'locks',
          'type' => TType::LST,
          'etype' => TType::STRUCT,
          'elem' => array(
            'type' => TType::STRUCT,
            'class' => '\metastore\ShowLocksResponseElement',
            ),
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['locks'])) {
        $this->locks = $vals['locks'];
      }
    }
  }

  public function getName() {
    return 'ShowLocksResponse';
  }

  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->locks = array();
            $_size442 = 0;
            $_etype445 = 0;
            $xfer += $input->readListBegin($_etype445, $_size442);
            for ($_i446 = 0; $_i446 < $_size442; ++$_i446)
            {
              $elem447 = null;
              $elem447 = new \metastore\ShowLocksResponseElement();
              $xfer += $elem447->read($input);
              $this->locks []= $elem447;
            }
            $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('ShowLocksResponse');
    if ($this->locks !== null) {
      if (!is_array($this->locks)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('locks', TType::LST, 1);
      {
        $output->writeListBegin(TType::STRUCT, count($this->locks));
        {
          foreach ($this->locks as $iter448)
          {
            $xfer += $iter448->write($output);
          }
        }
        $output->writeListEnd();
      }
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class HeartbeatRequest {
  static $_TSPEC;

  /**
   * @var int
   */
  public $lockid = null;
  /**
   * @var int
   */
  public $txnid = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'lockid',
          'type' => TType::I64,
          ),
        2 => array(
          'var' => 'txnid',
          'type' => TType::I64,
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['lockid'])) {
        $this->lockid = $vals['lockid'];
      }
      if (isset($vals['txnid'])) {
        $this->txnid = $vals['txnid'];
      }
    }
  }

  public function getName() {
    return 'HeartbeatRequest';
  }

  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::I64) {
            $xfer += $input->readI64($this->lockid);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 2:
          if ($ftype == TType::I64) {
            $xfer += $input->readI64($this->txnid);
          } 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('HeartbeatRequest');
    if ($this->lockid !== null) {
      $xfer += $output->writeFieldBegin('lockid', TType::I64, 1);
      $xfer += $output->writeI64($this->lockid);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->txnid !== null) {
      $xfer += $output->writeFieldBegin('txnid', TType::I64, 2);
      $xfer += $output->writeI64($this->txnid);
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class HeartbeatTxnRangeRequest {
  static $_TSPEC;

  /**
   * @var int
   */
  public $min = null;
  /**
   * @var int
   */
  public $max = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'min',
          'type' => TType::I64,
          ),
        2 => array(
          'var' => 'max',
          'type' => TType::I64,
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['min'])) {
        $this->min = $vals['min'];
      }
      if (isset($vals['max'])) {
        $this->max = $vals['max'];
      }
    }
  }

  public function getName() {
    return 'HeartbeatTxnRangeRequest';
  }

  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::I64) {
            $xfer += $input->readI64($this->min);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 2:
          if ($ftype == TType::I64) {
            $xfer += $input->readI64($this->max);
          } 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('HeartbeatTxnRangeRequest');
    if ($this->min !== null) {
      $xfer += $output->writeFieldBegin('min', TType::I64, 1);
      $xfer += $output->writeI64($this->min);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->max !== null) {
      $xfer += $output->writeFieldBegin('max', TType::I64, 2);
      $xfer += $output->writeI64($this->max);
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class HeartbeatTxnRangeResponse {
  static $_TSPEC;

  /**
   * @var int[]
   */
  public $aborted = null;
  /**
   * @var int[]
   */
  public $nosuch = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'aborted',
          'type' => TType::SET,
          'etype' => TType::I64,
          'elem' => array(
            'type' => TType::I64,
            ),
          ),
        2 => array(
          'var' => 'nosuch',
          'type' => TType::SET,
          'etype' => TType::I64,
          'elem' => array(
            'type' => TType::I64,
            ),
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['aborted'])) {
        $this->aborted = $vals['aborted'];
      }
      if (isset($vals['nosuch'])) {
        $this->nosuch = $vals['nosuch'];
      }
    }
  }

  public function getName() {
    return 'HeartbeatTxnRangeResponse';
  }

  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::SET) {
            $this->aborted = array();
            $_size449 = 0;
            $_etype452 = 0;
            $xfer += $input->readSetBegin($_etype452, $_size449);
            for ($_i453 = 0; $_i453 < $_size449; ++$_i453)
            {
              $elem454 = null;
              $xfer += $input->readI64($elem454);
              if (is_scalar($elem454)) {
                $this->aborted[$elem454] = true;
              } else {
                $this->aborted []= $elem454;
              }
            }
            $xfer += $input->readSetEnd();
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 2:
          if ($ftype == TType::SET) {
            $this->nosuch = array();
            $_size455 = 0;
            $_etype458 = 0;
            $xfer += $input->readSetBegin($_etype458, $_size455);
            for ($_i459 = 0; $_i459 < $_size455; ++$_i459)
            {
              $elem460 = null;
              $xfer += $input->readI64($elem460);
              if (is_scalar($elem460)) {
                $this->nosuch[$elem460] = true;
              } else {
                $this->nosuch []= $elem460;
              }
            }
            $xfer += $input->readSetEnd();
          } 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('HeartbeatTxnRangeResponse');
    if ($this->aborted !== null) {
      if (!is_array($this->aborted)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('aborted', TType::SET, 1);
      {
        $output->writeSetBegin(TType::I64, count($this->aborted));
        {
          foreach ($this->aborted as $iter461 => $iter462)
          {
            if (is_scalar($iter462)) {
            $xfer += $output->writeI64($iter461);
            } else {
            $xfer += $output->writeI64($iter462);
            }
          }
        }
        $output->writeSetEnd();
      }
      $xfer += $output->writeFieldEnd();
    }
    if ($this->nosuch !== null) {
      if (!is_array($this->nosuch)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('nosuch', TType::SET, 2);
      {
        $output->writeSetBegin(TType::I64, count($this->nosuch));
        {
          foreach ($this->nosuch as $iter463 => $iter464)
          {
            if (is_scalar($iter464)) {
            $xfer += $output->writeI64($iter463);
            } else {
            $xfer += $output->writeI64($iter464);
            }
          }
        }
        $output->writeSetEnd();
      }
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class CompactionRequest {
  static $_TSPEC;

  /**
   * @var string
   */
  public $dbname = null;
  /**
   * @var string
   */
  public $tablename = null;
  /**
   * @var string
   */
  public $partitionname = null;
  /**
   * @var int
   */
  public $type = null;
  /**
   * @var string
   */
  public $runas = null;
  /**
   * @var array
   */
  public $properties = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'dbname',
          'type' => TType::STRING,
          ),
        2 => array(
          'var' => 'tablename',
          'type' => TType::STRING,
          ),
        3 => array(
          'var' => 'partitionname',
          'type' => TType::STRING,
          ),
        4 => array(
          'var' => 'type',
          'type' => TType::I32,
          ),
        5 => array(
          'var' => 'runas',
          'type' => TType::STRING,
          ),
        6 => array(
          'var' => 'properties',
          'type' => TType::MAP,
          'ktype' => TType::STRING,
          'vtype' => TType::STRING,
          'key' => array(
            'type' => TType::STRING,
          ),
          'val' => array(
            'type' => TType::STRING,
            ),
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['dbname'])) {
        $this->dbname = $vals['dbname'];
      }
      if (isset($vals['tablename'])) {
        $this->tablename = $vals['tablename'];
      }
      if (isset($vals['partitionname'])) {
        $this->partitionname = $vals['partitionname'];
      }
      if (isset($vals['type'])) {
        $this->type = $vals['type'];
      }
      if (isset($vals['runas'])) {
        $this->runas = $vals['runas'];
      }
      if (isset($vals['properties'])) {
        $this->properties = $vals['properties'];
      }
    }
  }

  public function getName() {
    return 'CompactionRequest';
  }

  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->dbname);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 2:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->tablename);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 3:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->partitionname);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 4:
          if ($ftype == TType::I32) {
            $xfer += $input->readI32($this->type);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 5:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->runas);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 6:
          if ($ftype == TType::MAP) {
            $this->properties = array();
            $_size465 = 0;
            $_ktype466 = 0;
            $_vtype467 = 0;
            $xfer += $input->readMapBegin($_ktype466, $_vtype467, $_size465);
            for ($_i469 = 0; $_i469 < $_size465; ++$_i469)
            {
              $key470 = '';
              $val471 = '';
              $xfer += $input->readString($key470);
              $xfer += $input->readString($val471);
              $this->properties[$key470] = $val471;
            }
            $xfer += $input->readMapEnd();
          } 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('CompactionRequest');
    if ($this->dbname !== null) {
      $xfer += $output->writeFieldBegin('dbname', TType::STRING, 1);
      $xfer += $output->writeString($this->dbname);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->tablename !== null) {
      $xfer += $output->writeFieldBegin('tablename', TType::STRING, 2);
      $xfer += $output->writeString($this->tablename);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->partitionname !== null) {
      $xfer += $output->writeFieldBegin('partitionname', TType::STRING, 3);
      $xfer += $output->writeString($this->partitionname);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->type !== null) {
      $xfer += $output->writeFieldBegin('type', TType::I32, 4);
      $xfer += $output->writeI32($this->type);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->runas !== null) {
      $xfer += $output->writeFieldBegin('runas', TType::STRING, 5);
      $xfer += $output->writeString($this->runas);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->properties !== null) {
      if (!is_array($this->properties)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('properties', TType::MAP, 6);
      {
        $output->writeMapBegin(TType::STRING, TType::STRING, count($this->properties));
        {
          foreach ($this->properties as $kiter472 => $viter473)
          {
            $xfer += $output->writeString($kiter472);
            $xfer += $output->writeString($viter473);
          }
        }
        $output->writeMapEnd();
      }
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class CompactionResponse {
  static $_TSPEC;

  /**
   * @var int
   */
  public $id = null;
  /**
   * @var string
   */
  public $state = null;
  /**
   * @var bool
   */
  public $accepted = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'id',
          'type' => TType::I64,
          ),
        2 => array(
          'var' => 'state',
          'type' => TType::STRING,
          ),
        3 => array(
          'var' => 'accepted',
          'type' => TType::BOOL,
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['id'])) {
        $this->id = $vals['id'];
      }
      if (isset($vals['state'])) {
        $this->state = $vals['state'];
      }
      if (isset($vals['accepted'])) {
        $this->accepted = $vals['accepted'];
      }
    }
  }

  public function getName() {
    return 'CompactionResponse';
  }

  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::I64) {
            $xfer += $input->readI64($this->id);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 2:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->state);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 3:
          if ($ftype == TType::BOOL) {
            $xfer += $input->readBool($this->accepted);
          } 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('CompactionResponse');
    if ($this->id !== null) {
      $xfer += $output->writeFieldBegin('id', TType::I64, 1);
      $xfer += $output->writeI64($this->id);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->state !== null) {
      $xfer += $output->writeFieldBegin('state', TType::STRING, 2);
      $xfer += $output->writeString($this->state);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->accepted !== null) {
      $xfer += $output->writeFieldBegin('accepted', TType::BOOL, 3);
      $xfer += $output->writeBool($this->accepted);
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class ShowCompactRequest {
  static $_TSPEC;


  public function __construct() {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        );
    }
  }

  public function getName() {
    return 'ShowCompactRequest';
  }

  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)
      {
        default:
          $xfer += $input->skip($ftype);
          break;
      }
      $xfer += $input->readFieldEnd();
    }
    $xfer += $input->readStructEnd();
    return $xfer;
  }

  public function write($output) {
    $xfer = 0;
    $xfer += $output->writeStructBegin('ShowCompactRequest');
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class ShowCompactResponseElement {
  static $_TSPEC;

  /**
   * @var string
   */
  public $dbname = null;
  /**
   * @var string
   */
  public $tablename = null;
  /**
   * @var string
   */
  public $partitionname = null;
  /**
   * @var int
   */
  public $type = null;
  /**
   * @var string
   */
  public $state = null;
  /**
   * @var string
   */
  public $workerid = null;
  /**
   * @var int
   */
  public $start = null;
  /**
   * @var string
   */
  public $runAs = null;
  /**
   * @var int
   */
  public $hightestTxnId = null;
  /**
   * @var string
   */
  public $metaInfo = null;
  /**
   * @var int
   */
  public $endTime = null;
  /**
   * @var string
   */
  public $hadoopJobId = "None";
  /**
   * @var int
   */
  public $id = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'dbname',
          'type' => TType::STRING,
          ),
        2 => array(
          'var' => 'tablename',
          'type' => TType::STRING,
          ),
        3 => array(
          'var' => 'partitionname',
          'type' => TType::STRING,
          ),
        4 => array(
          'var' => 'type',
          'type' => TType::I32,
          ),
        5 => array(
          'var' => 'state',
          'type' => TType::STRING,
          ),
        6 => array(
          'var' => 'workerid',
          'type' => TType::STRING,
          ),
        7 => array(
          'var' => 'start',
          'type' => TType::I64,
          ),
        8 => array(
          'var' => 'runAs',
          'type' => TType::STRING,
          ),
        9 => array(
          'var' => 'hightestTxnId',
          'type' => TType::I64,
          ),
        10 => array(
          'var' => 'metaInfo',
          'type' => TType::STRING,
          ),
        11 => array(
          'var' => 'endTime',
          'type' => TType::I64,
          ),
        12 => array(
          'var' => 'hadoopJobId',
          'type' => TType::STRING,
          ),
        13 => array(
          'var' => 'id',
          'type' => TType::I64,
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['dbname'])) {
        $this->dbname = $vals['dbname'];
      }
      if (isset($vals['tablename'])) {
        $this->tablename = $vals['tablename'];
      }
      if (isset($vals['partitionname'])) {
        $this->partitionname = $vals['partitionname'];
      }
      if (isset($vals['type'])) {
        $this->type = $vals['type'];
      }
      if (isset($vals['state'])) {
        $this->state = $vals['state'];
      }
      if (isset($vals['workerid'])) {
        $this->workerid = $vals['workerid'];
      }
      if (isset($vals['start'])) {
        $this->start = $vals['start'];
      }
      if (isset($vals['runAs'])) {
        $this->runAs = $vals['runAs'];
      }
      if (isset($vals['hightestTxnId'])) {
        $this->hightestTxnId = $vals['hightestTxnId'];
      }
      if (isset($vals['metaInfo'])) {
        $this->metaInfo = $vals['metaInfo'];
      }
      if (isset($vals['endTime'])) {
        $this->endTime = $vals['endTime'];
      }
      if (isset($vals['hadoopJobId'])) {
        $this->hadoopJobId = $vals['hadoopJobId'];
      }
      if (isset($vals['id'])) {
        $this->id = $vals['id'];
      }
    }
  }

  public function getName() {
    return 'ShowCompactResponseElement';
  }

  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->dbname);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 2:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->tablename);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 3:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->partitionname);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 4:
          if ($ftype == TType::I32) {
            $xfer += $input->readI32($this->type);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 5:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->state);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 6:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->workerid);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 7:
          if ($ftype == TType::I64) {
            $xfer += $input->readI64($this->start);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 8:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->runAs);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 9:
          if ($ftype == TType::I64) {
            $xfer += $input->readI64($this->hightestTxnId);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 10:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->metaInfo);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 11:
          if ($ftype == TType::I64) {
            $xfer += $input->readI64($this->endTime);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 12:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->hadoopJobId);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 13:
          if ($ftype == TType::I64) {
            $xfer += $input->readI64($this->id);
          } 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('ShowCompactResponseElement');
    if ($this->dbname !== null) {
      $xfer += $output->writeFieldBegin('dbname', TType::STRING, 1);
      $xfer += $output->writeString($this->dbname);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->tablename !== null) {
      $xfer += $output->writeFieldBegin('tablename', TType::STRING, 2);
      $xfer += $output->writeString($this->tablename);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->partitionname !== null) {
      $xfer += $output->writeFieldBegin('partitionname', TType::STRING, 3);
      $xfer += $output->writeString($this->partitionname);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->type !== null) {
      $xfer += $output->writeFieldBegin('type', TType::I32, 4);
      $xfer += $output->writeI32($this->type);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->state !== null) {
      $xfer += $output->writeFieldBegin('state', TType::STRING, 5);
      $xfer += $output->writeString($this->state);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->workerid !== null) {
      $xfer += $output->writeFieldBegin('workerid', TType::STRING, 6);
      $xfer += $output->writeString($this->workerid);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->start !== null) {
      $xfer += $output->writeFieldBegin('start', TType::I64, 7);
      $xfer += $output->writeI64($this->start);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->runAs !== null) {
      $xfer += $output->writeFieldBegin('runAs', TType::STRING, 8);
      $xfer += $output->writeString($this->runAs);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->hightestTxnId !== null) {
      $xfer += $output->writeFieldBegin('hightestTxnId', TType::I64, 9);
      $xfer += $output->writeI64($this->hightestTxnId);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->metaInfo !== null) {
      $xfer += $output->writeFieldBegin('metaInfo', TType::STRING, 10);
      $xfer += $output->writeString($this->metaInfo);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->endTime !== null) {
      $xfer += $output->writeFieldBegin('endTime', TType::I64, 11);
      $xfer += $output->writeI64($this->endTime);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->hadoopJobId !== null) {
      $xfer += $output->writeFieldBegin('hadoopJobId', TType::STRING, 12);
      $xfer += $output->writeString($this->hadoopJobId);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->id !== null) {
      $xfer += $output->writeFieldBegin('id', TType::I64, 13);
      $xfer += $output->writeI64($this->id);
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class ShowCompactResponse {
  static $_TSPEC;

  /**
   * @var \metastore\ShowCompactResponseElement[]
   */
  public $compacts = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'compacts',
          'type' => TType::LST,
          'etype' => TType::STRUCT,
          'elem' => array(
            'type' => TType::STRUCT,
            'class' => '\metastore\ShowCompactResponseElement',
            ),
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['compacts'])) {
        $this->compacts = $vals['compacts'];
      }
    }
  }

  public function getName() {
    return 'ShowCompactResponse';
  }

  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->compacts = array();
            $_size474 = 0;
            $_etype477 = 0;
            $xfer += $input->readListBegin($_etype477, $_size474);
            for ($_i478 = 0; $_i478 < $_size474; ++$_i478)
            {
              $elem479 = null;
              $elem479 = new \metastore\ShowCompactResponseElement();
              $xfer += $elem479->read($input);
              $this->compacts []= $elem479;
            }
            $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('ShowCompactResponse');
    if ($this->compacts !== null) {
      if (!is_array($this->compacts)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('compacts', TType::LST, 1);
      {
        $output->writeListBegin(TType::STRUCT, count($this->compacts));
        {
          foreach ($this->compacts as $iter480)
          {
            $xfer += $iter480->write($output);
          }
        }
        $output->writeListEnd();
      }
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class AddDynamicPartitions {
  static $_TSPEC;

  /**
   * @var int
   */
  public $txnid = null;
  /**
   * @var string
   */
  public $dbname = null;
  /**
   * @var string
   */
  public $tablename = null;
  /**
   * @var string[]
   */
  public $partitionnames = null;
  /**
   * @var int
   */
  public $operationType =   5;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'txnid',
          'type' => TType::I64,
          ),
        2 => array(
          'var' => 'dbname',
          'type' => TType::STRING,
          ),
        3 => array(
          'var' => 'tablename',
          'type' => TType::STRING,
          ),
        4 => array(
          'var' => 'partitionnames',
          'type' => TType::LST,
          'etype' => TType::STRING,
          'elem' => array(
            'type' => TType::STRING,
            ),
          ),
        5 => array(
          'var' => 'operationType',
          'type' => TType::I32,
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['txnid'])) {
        $this->txnid = $vals['txnid'];
      }
      if (isset($vals['dbname'])) {
        $this->dbname = $vals['dbname'];
      }
      if (isset($vals['tablename'])) {
        $this->tablename = $vals['tablename'];
      }
      if (isset($vals['partitionnames'])) {
        $this->partitionnames = $vals['partitionnames'];
      }
      if (isset($vals['operationType'])) {
        $this->operationType = $vals['operationType'];
      }
    }
  }

  public function getName() {
    return 'AddDynamicPartitions';
  }

  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::I64) {
            $xfer += $input->readI64($this->txnid);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 2:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->dbname);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 3:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->tablename);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 4:
          if ($ftype == TType::LST) {
            $this->partitionnames = array();
            $_size481 = 0;
            $_etype484 = 0;
            $xfer += $input->readListBegin($_etype484, $_size481);
            for ($_i485 = 0; $_i485 < $_size481; ++$_i485)
            {
              $elem486 = null;
              $xfer += $input->readString($elem486);
              $this->partitionnames []= $elem486;
            }
            $xfer += $input->readListEnd();
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 5:
          if ($ftype == TType::I32) {
            $xfer += $input->readI32($this->operationType);
          } 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('AddDynamicPartitions');
    if ($this->txnid !== null) {
      $xfer += $output->writeFieldBegin('txnid', TType::I64, 1);
      $xfer += $output->writeI64($this->txnid);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->dbname !== null) {
      $xfer += $output->writeFieldBegin('dbname', TType::STRING, 2);
      $xfer += $output->writeString($this->dbname);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->tablename !== null) {
      $xfer += $output->writeFieldBegin('tablename', TType::STRING, 3);
      $xfer += $output->writeString($this->tablename);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->partitionnames !== null) {
      if (!is_array($this->partitionnames)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('partitionnames', TType::LST, 4);
      {
        $output->writeListBegin(TType::STRING, count($this->partitionnames));
        {
          foreach ($this->partitionnames as $iter487)
          {
            $xfer += $output->writeString($iter487);
          }
        }
        $output->writeListEnd();
      }
      $xfer += $output->writeFieldEnd();
    }
    if ($this->operationType !== null) {
      $xfer += $output->writeFieldBegin('operationType', TType::I32, 5);
      $xfer += $output->writeI32($this->operationType);
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class NotificationEventRequest {
  static $_TSPEC;

  /**
   * @var int
   */
  public $lastEvent = null;
  /**
   * @var int
   */
  public $maxEvents = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'lastEvent',
          'type' => TType::I64,
          ),
        2 => array(
          'var' => 'maxEvents',
          'type' => TType::I32,
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['lastEvent'])) {
        $this->lastEvent = $vals['lastEvent'];
      }
      if (isset($vals['maxEvents'])) {
        $this->maxEvents = $vals['maxEvents'];
      }
    }
  }

  public function getName() {
    return 'NotificationEventRequest';
  }

  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::I64) {
            $xfer += $input->readI64($this->lastEvent);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 2:
          if ($ftype == TType::I32) {
            $xfer += $input->readI32($this->maxEvents);
          } 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('NotificationEventRequest');
    if ($this->lastEvent !== null) {
      $xfer += $output->writeFieldBegin('lastEvent', TType::I64, 1);
      $xfer += $output->writeI64($this->lastEvent);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->maxEvents !== null) {
      $xfer += $output->writeFieldBegin('maxEvents', TType::I32, 2);
      $xfer += $output->writeI32($this->maxEvents);
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class NotificationEvent {
  static $_TSPEC;

  /**
   * @var int
   */
  public $eventId = null;
  /**
   * @var int
   */
  public $eventTime = null;
  /**
   * @var string
   */
  public $eventType = null;
  /**
   * @var string
   */
  public $dbName = null;
  /**
   * @var string
   */
  public $tableName = null;
  /**
   * @var string
   */
  public $message = null;
  /**
   * @var string
   */
  public $messageFormat = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'eventId',
          'type' => TType::I64,
          ),
        2 => array(
          'var' => 'eventTime',
          'type' => TType::I32,
          ),
        3 => array(
          'var' => 'eventType',
          'type' => TType::STRING,
          ),
        4 => array(
          'var' => 'dbName',
          'type' => TType::STRING,
          ),
        5 => array(
          'var' => 'tableName',
          'type' => TType::STRING,
          ),
        6 => array(
          'var' => 'message',
          'type' => TType::STRING,
          ),
        7 => array(
          'var' => 'messageFormat',
          'type' => TType::STRING,
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['eventId'])) {
        $this->eventId = $vals['eventId'];
      }
      if (isset($vals['eventTime'])) {
        $this->eventTime = $vals['eventTime'];
      }
      if (isset($vals['eventType'])) {
        $this->eventType = $vals['eventType'];
      }
      if (isset($vals['dbName'])) {
        $this->dbName = $vals['dbName'];
      }
      if (isset($vals['tableName'])) {
        $this->tableName = $vals['tableName'];
      }
      if (isset($vals['message'])) {
        $this->message = $vals['message'];
      }
      if (isset($vals['messageFormat'])) {
        $this->messageFormat = $vals['messageFormat'];
      }
    }
  }

  public function getName() {
    return 'NotificationEvent';
  }

  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::I64) {
            $xfer += $input->readI64($this->eventId);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 2:
          if ($ftype == TType::I32) {
            $xfer += $input->readI32($this->eventTime);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 3:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->eventType);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 4:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->dbName);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 5:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->tableName);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 6:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->message);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 7:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->messageFormat);
          } 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('NotificationEvent');
    if ($this->eventId !== null) {
      $xfer += $output->writeFieldBegin('eventId', TType::I64, 1);
      $xfer += $output->writeI64($this->eventId);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->eventTime !== null) {
      $xfer += $output->writeFieldBegin('eventTime', TType::I32, 2);
      $xfer += $output->writeI32($this->eventTime);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->eventType !== null) {
      $xfer += $output->writeFieldBegin('eventType', TType::STRING, 3);
      $xfer += $output->writeString($this->eventType);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->dbName !== null) {
      $xfer += $output->writeFieldBegin('dbName', TType::STRING, 4);
      $xfer += $output->writeString($this->dbName);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->tableName !== null) {
      $xfer += $output->writeFieldBegin('tableName', TType::STRING, 5);
      $xfer += $output->writeString($this->tableName);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->message !== null) {
      $xfer += $output->writeFieldBegin('message', TType::STRING, 6);
      $xfer += $output->writeString($this->message);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->messageFormat !== null) {
      $xfer += $output->writeFieldBegin('messageFormat', TType::STRING, 7);
      $xfer += $output->writeString($this->messageFormat);
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class NotificationEventResponse {
  static $_TSPEC;

  /**
   * @var \metastore\NotificationEvent[]
   */
  public $events = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'events',
          'type' => TType::LST,
          'etype' => TType::STRUCT,
          'elem' => array(
            'type' => TType::STRUCT,
            'class' => '\metastore\NotificationEvent',
            ),
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['events'])) {
        $this->events = $vals['events'];
      }
    }
  }

  public function getName() {
    return 'NotificationEventResponse';
  }

  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->events = array();
            $_size488 = 0;
            $_etype491 = 0;
            $xfer += $input->readListBegin($_etype491, $_size488);
            for ($_i492 = 0; $_i492 < $_size488; ++$_i492)
            {
              $elem493 = null;
              $elem493 = new \metastore\NotificationEvent();
              $xfer += $elem493->read($input);
              $this->events []= $elem493;
            }
            $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('NotificationEventResponse');
    if ($this->events !== null) {
      if (!is_array($this->events)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('events', TType::LST, 1);
      {
        $output->writeListBegin(TType::STRUCT, count($this->events));
        {
          foreach ($this->events as $iter494)
          {
            $xfer += $iter494->write($output);
          }
        }
        $output->writeListEnd();
      }
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class CurrentNotificationEventId {
  static $_TSPEC;

  /**
   * @var int
   */
  public $eventId = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'eventId',
          'type' => TType::I64,
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['eventId'])) {
        $this->eventId = $vals['eventId'];
      }
    }
  }

  public function getName() {
    return 'CurrentNotificationEventId';
  }

  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::I64) {
            $xfer += $input->readI64($this->eventId);
          } 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('CurrentNotificationEventId');
    if ($this->eventId !== null) {
      $xfer += $output->writeFieldBegin('eventId', TType::I64, 1);
      $xfer += $output->writeI64($this->eventId);
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class InsertEventRequestData {
  static $_TSPEC;

  /**
   * @var string[]
   */
  public $filesAdded = null;
  /**
   * @var string[]
   */
  public $filesAddedChecksum = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'filesAdded',
          'type' => TType::LST,
          'etype' => TType::STRING,
          'elem' => array(
            'type' => TType::STRING,
            ),
          ),
        2 => array(
          'var' => 'filesAddedChecksum',
          'type' => TType::LST,
          'etype' => TType::STRING,
          'elem' => array(
            'type' => TType::STRING,
            ),
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['filesAdded'])) {
        $this->filesAdded = $vals['filesAdded'];
      }
      if (isset($vals['filesAddedChecksum'])) {
        $this->filesAddedChecksum = $vals['filesAddedChecksum'];
      }
    }
  }

  public function getName() {
    return 'InsertEventRequestData';
  }

  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->filesAdded = array();
            $_size495 = 0;
            $_etype498 = 0;
            $xfer += $input->readListBegin($_etype498, $_size495);
            for ($_i499 = 0; $_i499 < $_size495; ++$_i499)
            {
              $elem500 = null;
              $xfer += $input->readString($elem500);
              $this->filesAdded []= $elem500;
            }
            $xfer += $input->readListEnd();
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 2:
          if ($ftype == TType::LST) {
            $this->filesAddedChecksum = array();
            $_size501 = 0;
            $_etype504 = 0;
            $xfer += $input->readListBegin($_etype504, $_size501);
            for ($_i505 = 0; $_i505 < $_size501; ++$_i505)
            {
              $elem506 = null;
              $xfer += $input->readString($elem506);
              $this->filesAddedChecksum []= $elem506;
            }
            $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('InsertEventRequestData');
    if ($this->filesAdded !== null) {
      if (!is_array($this->filesAdded)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('filesAdded', TType::LST, 1);
      {
        $output->writeListBegin(TType::STRING, count($this->filesAdded));
        {
          foreach ($this->filesAdded as $iter507)
          {
            $xfer += $output->writeString($iter507);
          }
        }
        $output->writeListEnd();
      }
      $xfer += $output->writeFieldEnd();
    }
    if ($this->filesAddedChecksum !== null) {
      if (!is_array($this->filesAddedChecksum)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('filesAddedChecksum', TType::LST, 2);
      {
        $output->writeListBegin(TType::STRING, count($this->filesAddedChecksum));
        {
          foreach ($this->filesAddedChecksum as $iter508)
          {
            $xfer += $output->writeString($iter508);
          }
        }
        $output->writeListEnd();
      }
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class FireEventRequestData {
  static $_TSPEC;

  /**
   * @var \metastore\InsertEventRequestData
   */
  public $insertData = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'insertData',
          'type' => TType::STRUCT,
          'class' => '\metastore\InsertEventRequestData',
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['insertData'])) {
        $this->insertData = $vals['insertData'];
      }
    }
  }

  public function getName() {
    return 'FireEventRequestData';
  }

  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::STRUCT) {
            $this->insertData = new \metastore\InsertEventRequestData();
            $xfer += $this->insertData->read($input);
          } 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('FireEventRequestData');
    if ($this->insertData !== null) {
      if (!is_object($this->insertData)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('insertData', TType::STRUCT, 1);
      $xfer += $this->insertData->write($output);
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class FireEventRequest {
  static $_TSPEC;

  /**
   * @var bool
   */
  public $successful = null;
  /**
   * @var \metastore\FireEventRequestData
   */
  public $data = null;
  /**
   * @var string
   */
  public $dbName = null;
  /**
   * @var string
   */
  public $tableName = null;
  /**
   * @var string[]
   */
  public $partitionVals = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'successful',
          'type' => TType::BOOL,
          ),
        2 => array(
          'var' => 'data',
          'type' => TType::STRUCT,
          'class' => '\metastore\FireEventRequestData',
          ),
        3 => array(
          'var' => 'dbName',
          'type' => TType::STRING,
          ),
        4 => array(
          'var' => 'tableName',
          'type' => TType::STRING,
          ),
        5 => array(
          'var' => 'partitionVals',
          'type' => TType::LST,
          'etype' => TType::STRING,
          'elem' => array(
            'type' => TType::STRING,
            ),
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['successful'])) {
        $this->successful = $vals['successful'];
      }
      if (isset($vals['data'])) {
        $this->data = $vals['data'];
      }
      if (isset($vals['dbName'])) {
        $this->dbName = $vals['dbName'];
      }
      if (isset($vals['tableName'])) {
        $this->tableName = $vals['tableName'];
      }
      if (isset($vals['partitionVals'])) {
        $this->partitionVals = $vals['partitionVals'];
      }
    }
  }

  public function getName() {
    return 'FireEventRequest';
  }

  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::BOOL) {
            $xfer += $input->readBool($this->successful);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 2:
          if ($ftype == TType::STRUCT) {
            $this->data = new \metastore\FireEventRequestData();
            $xfer += $this->data->read($input);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 3:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->dbName);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 4:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->tableName);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 5:
          if ($ftype == TType::LST) {
            $this->partitionVals = array();
            $_size509 = 0;
            $_etype512 = 0;
            $xfer += $input->readListBegin($_etype512, $_size509);
            for ($_i513 = 0; $_i513 < $_size509; ++$_i513)
            {
              $elem514 = null;
              $xfer += $input->readString($elem514);
              $this->partitionVals []= $elem514;
            }
            $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('FireEventRequest');
    if ($this->successful !== null) {
      $xfer += $output->writeFieldBegin('successful', TType::BOOL, 1);
      $xfer += $output->writeBool($this->successful);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->data !== null) {
      if (!is_object($this->data)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('data', TType::STRUCT, 2);
      $xfer += $this->data->write($output);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->dbName !== null) {
      $xfer += $output->writeFieldBegin('dbName', TType::STRING, 3);
      $xfer += $output->writeString($this->dbName);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->tableName !== null) {
      $xfer += $output->writeFieldBegin('tableName', TType::STRING, 4);
      $xfer += $output->writeString($this->tableName);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->partitionVals !== null) {
      if (!is_array($this->partitionVals)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('partitionVals', TType::LST, 5);
      {
        $output->writeListBegin(TType::STRING, count($this->partitionVals));
        {
          foreach ($this->partitionVals as $iter515)
          {
            $xfer += $output->writeString($iter515);
          }
        }
        $output->writeListEnd();
      }
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class FireEventResponse {
  static $_TSPEC;


  public function __construct() {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        );
    }
  }

  public function getName() {
    return 'FireEventResponse';
  }

  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)
      {
        default:
          $xfer += $input->skip($ftype);
          break;
      }
      $xfer += $input->readFieldEnd();
    }
    $xfer += $input->readStructEnd();
    return $xfer;
  }

  public function write($output) {
    $xfer = 0;
    $xfer += $output->writeStructBegin('FireEventResponse');
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class MetadataPpdResult {
  static $_TSPEC;

  /**
   * @var string
   */
  public $metadata = null;
  /**
   * @var string
   */
  public $includeBitset = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'metadata',
          'type' => TType::STRING,
          ),
        2 => array(
          'var' => 'includeBitset',
          'type' => TType::STRING,
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['metadata'])) {
        $this->metadata = $vals['metadata'];
      }
      if (isset($vals['includeBitset'])) {
        $this->includeBitset = $vals['includeBitset'];
      }
    }
  }

  public function getName() {
    return 'MetadataPpdResult';
  }

  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->metadata);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 2:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->includeBitset);
          } 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('MetadataPpdResult');
    if ($this->metadata !== null) {
      $xfer += $output->writeFieldBegin('metadata', TType::STRING, 1);
      $xfer += $output->writeString($this->metadata);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->includeBitset !== null) {
      $xfer += $output->writeFieldBegin('includeBitset', TType::STRING, 2);
      $xfer += $output->writeString($this->includeBitset);
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class GetFileMetadataByExprResult {
  static $_TSPEC;

  /**
   * @var array
   */
  public $metadata = null;
  /**
   * @var bool
   */
  public $isSupported = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'metadata',
          'type' => TType::MAP,
          'ktype' => TType::I64,
          'vtype' => TType::STRUCT,
          'key' => array(
            'type' => TType::I64,
          ),
          'val' => array(
            'type' => TType::STRUCT,
            'class' => '\metastore\MetadataPpdResult',
            ),
          ),
        2 => array(
          'var' => 'isSupported',
          'type' => TType::BOOL,
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['metadata'])) {
        $this->metadata = $vals['metadata'];
      }
      if (isset($vals['isSupported'])) {
        $this->isSupported = $vals['isSupported'];
      }
    }
  }

  public function getName() {
    return 'GetFileMetadataByExprResult';
  }

  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::MAP) {
            $this->metadata = array();
            $_size516 = 0;
            $_ktype517 = 0;
            $_vtype518 = 0;
            $xfer += $input->readMapBegin($_ktype517, $_vtype518, $_size516);
            for ($_i520 = 0; $_i520 < $_size516; ++$_i520)
            {
              $key521 = 0;
              $val522 = new \metastore\MetadataPpdResult();
              $xfer += $input->readI64($key521);
              $val522 = new \metastore\MetadataPpdResult();
              $xfer += $val522->read($input);
              $this->metadata[$key521] = $val522;
            }
            $xfer += $input->readMapEnd();
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 2:
          if ($ftype == TType::BOOL) {
            $xfer += $input->readBool($this->isSupported);
          } 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('GetFileMetadataByExprResult');
    if ($this->metadata !== null) {
      if (!is_array($this->metadata)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('metadata', TType::MAP, 1);
      {
        $output->writeMapBegin(TType::I64, TType::STRUCT, count($this->metadata));
        {
          foreach ($this->metadata as $kiter523 => $viter524)
          {
            $xfer += $output->writeI64($kiter523);
            $xfer += $viter524->write($output);
          }
        }
        $output->writeMapEnd();
      }
      $xfer += $output->writeFieldEnd();
    }
    if ($this->isSupported !== null) {
      $xfer += $output->writeFieldBegin('isSupported', TType::BOOL, 2);
      $xfer += $output->writeBool($this->isSupported);
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class GetFileMetadataByExprRequest {
  static $_TSPEC;

  /**
   * @var int[]
   */
  public $fileIds = null;
  /**
   * @var string
   */
  public $expr = null;
  /**
   * @var bool
   */
  public $doGetFooters = null;
  /**
   * @var int
   */
  public $type = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'fileIds',
          'type' => TType::LST,
          'etype' => TType::I64,
          'elem' => array(
            'type' => TType::I64,
            ),
          ),
        2 => array(
          'var' => 'expr',
          'type' => TType::STRING,
          ),
        3 => array(
          'var' => 'doGetFooters',
          'type' => TType::BOOL,
          ),
        4 => array(
          'var' => 'type',
          'type' => TType::I32,
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['fileIds'])) {
        $this->fileIds = $vals['fileIds'];
      }
      if (isset($vals['expr'])) {
        $this->expr = $vals['expr'];
      }
      if (isset($vals['doGetFooters'])) {
        $this->doGetFooters = $vals['doGetFooters'];
      }
      if (isset($vals['type'])) {
        $this->type = $vals['type'];
      }
    }
  }

  public function getName() {
    return 'GetFileMetadataByExprRequest';
  }

  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->fileIds = array();
            $_size525 = 0;
            $_etype528 = 0;
            $xfer += $input->readListBegin($_etype528, $_size525);
            for ($_i529 = 0; $_i529 < $_size525; ++$_i529)
            {
              $elem530 = null;
              $xfer += $input->readI64($elem530);
              $this->fileIds []= $elem530;
            }
            $xfer += $input->readListEnd();
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 2:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->expr);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 3:
          if ($ftype == TType::BOOL) {
            $xfer += $input->readBool($this->doGetFooters);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 4:
          if ($ftype == TType::I32) {
            $xfer += $input->readI32($this->type);
          } 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('GetFileMetadataByExprRequest');
    if ($this->fileIds !== null) {
      if (!is_array($this->fileIds)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('fileIds', TType::LST, 1);
      {
        $output->writeListBegin(TType::I64, count($this->fileIds));
        {
          foreach ($this->fileIds as $iter531)
          {
            $xfer += $output->writeI64($iter531);
          }
        }
        $output->writeListEnd();
      }
      $xfer += $output->writeFieldEnd();
    }
    if ($this->expr !== null) {
      $xfer += $output->writeFieldBegin('expr', TType::STRING, 2);
      $xfer += $output->writeString($this->expr);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->doGetFooters !== null) {
      $xfer += $output->writeFieldBegin('doGetFooters', TType::BOOL, 3);
      $xfer += $output->writeBool($this->doGetFooters);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->type !== null) {
      $xfer += $output->writeFieldBegin('type', TType::I32, 4);
      $xfer += $output->writeI32($this->type);
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class GetFileMetadataResult {
  static $_TSPEC;

  /**
   * @var array
   */
  public $metadata = null;
  /**
   * @var bool
   */
  public $isSupported = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'metadata',
          'type' => TType::MAP,
          'ktype' => TType::I64,
          'vtype' => TType::STRING,
          'key' => array(
            'type' => TType::I64,
          ),
          'val' => array(
            'type' => TType::STRING,
            ),
          ),
        2 => array(
          'var' => 'isSupported',
          'type' => TType::BOOL,
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['metadata'])) {
        $this->metadata = $vals['metadata'];
      }
      if (isset($vals['isSupported'])) {
        $this->isSupported = $vals['isSupported'];
      }
    }
  }

  public function getName() {
    return 'GetFileMetadataResult';
  }

  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::MAP) {
            $this->metadata = array();
            $_size532 = 0;
            $_ktype533 = 0;
            $_vtype534 = 0;
            $xfer += $input->readMapBegin($_ktype533, $_vtype534, $_size532);
            for ($_i536 = 0; $_i536 < $_size532; ++$_i536)
            {
              $key537 = 0;
              $val538 = '';
              $xfer += $input->readI64($key537);
              $xfer += $input->readString($val538);
              $this->metadata[$key537] = $val538;
            }
            $xfer += $input->readMapEnd();
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 2:
          if ($ftype == TType::BOOL) {
            $xfer += $input->readBool($this->isSupported);
          } 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('GetFileMetadataResult');
    if ($this->metadata !== null) {
      if (!is_array($this->metadata)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('metadata', TType::MAP, 1);
      {
        $output->writeMapBegin(TType::I64, TType::STRING, count($this->metadata));
        {
          foreach ($this->metadata as $kiter539 => $viter540)
          {
            $xfer += $output->writeI64($kiter539);
            $xfer += $output->writeString($viter540);
          }
        }
        $output->writeMapEnd();
      }
      $xfer += $output->writeFieldEnd();
    }
    if ($this->isSupported !== null) {
      $xfer += $output->writeFieldBegin('isSupported', TType::BOOL, 2);
      $xfer += $output->writeBool($this->isSupported);
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class GetFileMetadataRequest {
  static $_TSPEC;

  /**
   * @var int[]
   */
  public $fileIds = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'fileIds',
          'type' => TType::LST,
          'etype' => TType::I64,
          'elem' => array(
            'type' => TType::I64,
            ),
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['fileIds'])) {
        $this->fileIds = $vals['fileIds'];
      }
    }
  }

  public function getName() {
    return 'GetFileMetadataRequest';
  }

  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->fileIds = array();
            $_size541 = 0;
            $_etype544 = 0;
            $xfer += $input->readListBegin($_etype544, $_size541);
            for ($_i545 = 0; $_i545 < $_size541; ++$_i545)
            {
              $elem546 = null;
              $xfer += $input->readI64($elem546);
              $this->fileIds []= $elem546;
            }
            $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('GetFileMetadataRequest');
    if ($this->fileIds !== null) {
      if (!is_array($this->fileIds)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('fileIds', TType::LST, 1);
      {
        $output->writeListBegin(TType::I64, count($this->fileIds));
        {
          foreach ($this->fileIds as $iter547)
          {
            $xfer += $output->writeI64($iter547);
          }
        }
        $output->writeListEnd();
      }
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class PutFileMetadataResult {
  static $_TSPEC;


  public function __construct() {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        );
    }
  }

  public function getName() {
    return 'PutFileMetadataResult';
  }

  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)
      {
        default:
          $xfer += $input->skip($ftype);
          break;
      }
      $xfer += $input->readFieldEnd();
    }
    $xfer += $input->readStructEnd();
    return $xfer;
  }

  public function write($output) {
    $xfer = 0;
    $xfer += $output->writeStructBegin('PutFileMetadataResult');
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class PutFileMetadataRequest {
  static $_TSPEC;

  /**
   * @var int[]
   */
  public $fileIds = null;
  /**
   * @var string[]
   */
  public $metadata = null;
  /**
   * @var int
   */
  public $type = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'fileIds',
          'type' => TType::LST,
          'etype' => TType::I64,
          'elem' => array(
            'type' => TType::I64,
            ),
          ),
        2 => array(
          'var' => 'metadata',
          'type' => TType::LST,
          'etype' => TType::STRING,
          'elem' => array(
            'type' => TType::STRING,
            ),
          ),
        3 => array(
          'var' => 'type',
          'type' => TType::I32,
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['fileIds'])) {
        $this->fileIds = $vals['fileIds'];
      }
      if (isset($vals['metadata'])) {
        $this->metadata = $vals['metadata'];
      }
      if (isset($vals['type'])) {
        $this->type = $vals['type'];
      }
    }
  }

  public function getName() {
    return 'PutFileMetadataRequest';
  }

  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->fileIds = array();
            $_size548 = 0;
            $_etype551 = 0;
            $xfer += $input->readListBegin($_etype551, $_size548);
            for ($_i552 = 0; $_i552 < $_size548; ++$_i552)
            {
              $elem553 = null;
              $xfer += $input->readI64($elem553);
              $this->fileIds []= $elem553;
            }
            $xfer += $input->readListEnd();
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 2:
          if ($ftype == TType::LST) {
            $this->metadata = array();
            $_size554 = 0;
            $_etype557 = 0;
            $xfer += $input->readListBegin($_etype557, $_size554);
            for ($_i558 = 0; $_i558 < $_size554; ++$_i558)
            {
              $elem559 = null;
              $xfer += $input->readString($elem559);
              $this->metadata []= $elem559;
            }
            $xfer += $input->readListEnd();
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 3:
          if ($ftype == TType::I32) {
            $xfer += $input->readI32($this->type);
          } 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('PutFileMetadataRequest');
    if ($this->fileIds !== null) {
      if (!is_array($this->fileIds)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('fileIds', TType::LST, 1);
      {
        $output->writeListBegin(TType::I64, count($this->fileIds));
        {
          foreach ($this->fileIds as $iter560)
          {
            $xfer += $output->writeI64($iter560);
          }
        }
        $output->writeListEnd();
      }
      $xfer += $output->writeFieldEnd();
    }
    if ($this->metadata !== null) {
      if (!is_array($this->metadata)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('metadata', TType::LST, 2);
      {
        $output->writeListBegin(TType::STRING, count($this->metadata));
        {
          foreach ($this->metadata as $iter561)
          {
            $xfer += $output->writeString($iter561);
          }
        }
        $output->writeListEnd();
      }
      $xfer += $output->writeFieldEnd();
    }
    if ($this->type !== null) {
      $xfer += $output->writeFieldBegin('type', TType::I32, 3);
      $xfer += $output->writeI32($this->type);
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class ClearFileMetadataResult {
  static $_TSPEC;


  public function __construct() {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        );
    }
  }

  public function getName() {
    return 'ClearFileMetadataResult';
  }

  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)
      {
        default:
          $xfer += $input->skip($ftype);
          break;
      }
      $xfer += $input->readFieldEnd();
    }
    $xfer += $input->readStructEnd();
    return $xfer;
  }

  public function write($output) {
    $xfer = 0;
    $xfer += $output->writeStructBegin('ClearFileMetadataResult');
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class ClearFileMetadataRequest {
  static $_TSPEC;

  /**
   * @var int[]
   */
  public $fileIds = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'fileIds',
          'type' => TType::LST,
          'etype' => TType::I64,
          'elem' => array(
            'type' => TType::I64,
            ),
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['fileIds'])) {
        $this->fileIds = $vals['fileIds'];
      }
    }
  }

  public function getName() {
    return 'ClearFileMetadataRequest';
  }

  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->fileIds = array();
            $_size562 = 0;
            $_etype565 = 0;
            $xfer += $input->readListBegin($_etype565, $_size562);
            for ($_i566 = 0; $_i566 < $_size562; ++$_i566)
            {
              $elem567 = null;
              $xfer += $input->readI64($elem567);
              $this->fileIds []= $elem567;
            }
            $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('ClearFileMetadataRequest');
    if ($this->fileIds !== null) {
      if (!is_array($this->fileIds)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('fileIds', TType::LST, 1);
      {
        $output->writeListBegin(TType::I64, count($this->fileIds));
        {
          foreach ($this->fileIds as $iter568)
          {
            $xfer += $output->writeI64($iter568);
          }
        }
        $output->writeListEnd();
      }
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class CacheFileMetadataResult {
  static $_TSPEC;

  /**
   * @var bool
   */
  public $isSupported = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'isSupported',
          'type' => TType::BOOL,
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['isSupported'])) {
        $this->isSupported = $vals['isSupported'];
      }
    }
  }

  public function getName() {
    return 'CacheFileMetadataResult';
  }

  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::BOOL) {
            $xfer += $input->readBool($this->isSupported);
          } 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('CacheFileMetadataResult');
    if ($this->isSupported !== null) {
      $xfer += $output->writeFieldBegin('isSupported', TType::BOOL, 1);
      $xfer += $output->writeBool($this->isSupported);
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class CacheFileMetadataRequest {
  static $_TSPEC;

  /**
   * @var string
   */
  public $dbName = null;
  /**
   * @var string
   */
  public $tblName = null;
  /**
   * @var string
   */
  public $partName = null;
  /**
   * @var bool
   */
  public $isAllParts = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'dbName',
          'type' => TType::STRING,
          ),
        2 => array(
          'var' => 'tblName',
          'type' => TType::STRING,
          ),
        3 => array(
          'var' => 'partName',
          'type' => TType::STRING,
          ),
        4 => array(
          'var' => 'isAllParts',
          'type' => TType::BOOL,
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['dbName'])) {
        $this->dbName = $vals['dbName'];
      }
      if (isset($vals['tblName'])) {
        $this->tblName = $vals['tblName'];
      }
      if (isset($vals['partName'])) {
        $this->partName = $vals['partName'];
      }
      if (isset($vals['isAllParts'])) {
        $this->isAllParts = $vals['isAllParts'];
      }
    }
  }

  public function getName() {
    return 'CacheFileMetadataRequest';
  }

  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->dbName);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 2:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->tblName);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 3:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->partName);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 4:
          if ($ftype == TType::BOOL) {
            $xfer += $input->readBool($this->isAllParts);
          } 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('CacheFileMetadataRequest');
    if ($this->dbName !== null) {
      $xfer += $output->writeFieldBegin('dbName', TType::STRING, 1);
      $xfer += $output->writeString($this->dbName);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->tblName !== null) {
      $xfer += $output->writeFieldBegin('tblName', TType::STRING, 2);
      $xfer += $output->writeString($this->tblName);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->partName !== null) {
      $xfer += $output->writeFieldBegin('partName', TType::STRING, 3);
      $xfer += $output->writeString($this->partName);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->isAllParts !== null) {
      $xfer += $output->writeFieldBegin('isAllParts', TType::BOOL, 4);
      $xfer += $output->writeBool($this->isAllParts);
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class GetAllFunctionsResponse {
  static $_TSPEC;

  /**
   * @var \metastore\Function[]
   */
  public $functions = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'functions',
          'type' => TType::LST,
          'etype' => TType::STRUCT,
          'elem' => array(
            'type' => TType::STRUCT,
            'class' => '\metastore\Function',
            ),
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['functions'])) {
        $this->functions = $vals['functions'];
      }
    }
  }

  public function getName() {
    return 'GetAllFunctionsResponse';
  }

  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->functions = array();
            $_size569 = 0;
            $_etype572 = 0;
            $xfer += $input->readListBegin($_etype572, $_size569);
            for ($_i573 = 0; $_i573 < $_size569; ++$_i573)
            {
              $elem574 = null;
              $elem574 = new \metastore\Function();
              $xfer += $elem574->read($input);
              $this->functions []= $elem574;
            }
            $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('GetAllFunctionsResponse');
    if ($this->functions !== null) {
      if (!is_array($this->functions)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('functions', TType::LST, 1);
      {
        $output->writeListBegin(TType::STRUCT, count($this->functions));
        {
          foreach ($this->functions as $iter575)
          {
            $xfer += $iter575->write($output);
          }
        }
        $output->writeListEnd();
      }
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class ClientCapabilities {
  static $_TSPEC;

  /**
   * @var int[]
   */
  public $values = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'values',
          'type' => TType::LST,
          'etype' => TType::I32,
          'elem' => array(
            'type' => TType::I32,
            ),
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['values'])) {
        $this->values = $vals['values'];
      }
    }
  }

  public function getName() {
    return 'ClientCapabilities';
  }

  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->values = array();
            $_size576 = 0;
            $_etype579 = 0;
            $xfer += $input->readListBegin($_etype579, $_size576);
            for ($_i580 = 0; $_i580 < $_size576; ++$_i580)
            {
              $elem581 = null;
              $xfer += $input->readI32($elem581);
              $this->values []= $elem581;
            }
            $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('ClientCapabilities');
    if ($this->values !== null) {
      if (!is_array($this->values)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('values', TType::LST, 1);
      {
        $output->writeListBegin(TType::I32, count($this->values));
        {
          foreach ($this->values as $iter582)
          {
            $xfer += $output->writeI32($iter582);
          }
        }
        $output->writeListEnd();
      }
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class GetTableRequest {
  static $_TSPEC;

  /**
   * @var string
   */
  public $dbName = null;
  /**
   * @var string
   */
  public $tblName = null;
  /**
   * @var \metastore\ClientCapabilities
   */
  public $capabilities = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'dbName',
          'type' => TType::STRING,
          ),
        2 => array(
          'var' => 'tblName',
          'type' => TType::STRING,
          ),
        3 => array(
          'var' => 'capabilities',
          'type' => TType::STRUCT,
          'class' => '\metastore\ClientCapabilities',
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['dbName'])) {
        $this->dbName = $vals['dbName'];
      }
      if (isset($vals['tblName'])) {
        $this->tblName = $vals['tblName'];
      }
      if (isset($vals['capabilities'])) {
        $this->capabilities = $vals['capabilities'];
      }
    }
  }

  public function getName() {
    return 'GetTableRequest';
  }

  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->dbName);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 2:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->tblName);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 3:
          if ($ftype == TType::STRUCT) {
            $this->capabilities = new \metastore\ClientCapabilities();
            $xfer += $this->capabilities->read($input);
          } 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('GetTableRequest');
    if ($this->dbName !== null) {
      $xfer += $output->writeFieldBegin('dbName', TType::STRING, 1);
      $xfer += $output->writeString($this->dbName);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->tblName !== null) {
      $xfer += $output->writeFieldBegin('tblName', TType::STRING, 2);
      $xfer += $output->writeString($this->tblName);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->capabilities !== null) {
      if (!is_object($this->capabilities)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('capabilities', TType::STRUCT, 3);
      $xfer += $this->capabilities->write($output);
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class GetTableResult {
  static $_TSPEC;

  /**
   * @var \metastore\Table
   */
  public $table = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'table',
          'type' => TType::STRUCT,
          'class' => '\metastore\Table',
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['table'])) {
        $this->table = $vals['table'];
      }
    }
  }

  public function getName() {
    return 'GetTableResult';
  }

  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::STRUCT) {
            $this->table = new \metastore\Table();
            $xfer += $this->table->read($input);
          } 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('GetTableResult');
    if ($this->table !== null) {
      if (!is_object($this->table)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('table', TType::STRUCT, 1);
      $xfer += $this->table->write($output);
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class GetTablesRequest {
  static $_TSPEC;

  /**
   * @var string
   */
  public $dbName = null;
  /**
   * @var string[]
   */
  public $tblNames = null;
  /**
   * @var \metastore\ClientCapabilities
   */
  public $capabilities = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'dbName',
          'type' => TType::STRING,
          ),
        2 => array(
          'var' => 'tblNames',
          'type' => TType::LST,
          'etype' => TType::STRING,
          'elem' => array(
            'type' => TType::STRING,
            ),
          ),
        3 => array(
          'var' => 'capabilities',
          'type' => TType::STRUCT,
          'class' => '\metastore\ClientCapabilities',
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['dbName'])) {
        $this->dbName = $vals['dbName'];
      }
      if (isset($vals['tblNames'])) {
        $this->tblNames = $vals['tblNames'];
      }
      if (isset($vals['capabilities'])) {
        $this->capabilities = $vals['capabilities'];
      }
    }
  }

  public function getName() {
    return 'GetTablesRequest';
  }

  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->dbName);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 2:
          if ($ftype == TType::LST) {
            $this->tblNames = array();
            $_size583 = 0;
            $_etype586 = 0;
            $xfer += $input->readListBegin($_etype586, $_size583);
            for ($_i587 = 0; $_i587 < $_size583; ++$_i587)
            {
              $elem588 = null;
              $xfer += $input->readString($elem588);
              $this->tblNames []= $elem588;
            }
            $xfer += $input->readListEnd();
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 3:
          if ($ftype == TType::STRUCT) {
            $this->capabilities = new \metastore\ClientCapabilities();
            $xfer += $this->capabilities->read($input);
          } 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('GetTablesRequest');
    if ($this->dbName !== null) {
      $xfer += $output->writeFieldBegin('dbName', TType::STRING, 1);
      $xfer += $output->writeString($this->dbName);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->tblNames !== null) {
      if (!is_array($this->tblNames)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('tblNames', TType::LST, 2);
      {
        $output->writeListBegin(TType::STRING, count($this->tblNames));
        {
          foreach ($this->tblNames as $iter589)
          {
            $xfer += $output->writeString($iter589);
          }
        }
        $output->writeListEnd();
      }
      $xfer += $output->writeFieldEnd();
    }
    if ($this->capabilities !== null) {
      if (!is_object($this->capabilities)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('capabilities', TType::STRUCT, 3);
      $xfer += $this->capabilities->write($output);
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class GetTablesResult {
  static $_TSPEC;

  /**
   * @var \metastore\Table[]
   */
  public $tables = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'tables',
          'type' => TType::LST,
          'etype' => TType::STRUCT,
          'elem' => array(
            'type' => TType::STRUCT,
            'class' => '\metastore\Table',
            ),
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['tables'])) {
        $this->tables = $vals['tables'];
      }
    }
  }

  public function getName() {
    return 'GetTablesResult';
  }

  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->tables = array();
            $_size590 = 0;
            $_etype593 = 0;
            $xfer += $input->readListBegin($_etype593, $_size590);
            for ($_i594 = 0; $_i594 < $_size590; ++$_i594)
            {
              $elem595 = null;
              $elem595 = new \metastore\Table();
              $xfer += $elem595->read($input);
              $this->tables []= $elem595;
            }
            $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('GetTablesResult');
    if ($this->tables !== null) {
      if (!is_array($this->tables)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('tables', TType::LST, 1);
      {
        $output->writeListBegin(TType::STRUCT, count($this->tables));
        {
          foreach ($this->tables as $iter596)
          {
            $xfer += $iter596->write($output);
          }
        }
        $output->writeListEnd();
      }
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class TableMeta {
  static $_TSPEC;

  /**
   * @var string
   */
  public $dbName = null;
  /**
   * @var string
   */
  public $tableName = null;
  /**
   * @var string
   */
  public $tableType = null;
  /**
   * @var string
   */
  public $comments = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'dbName',
          'type' => TType::STRING,
          ),
        2 => array(
          'var' => 'tableName',
          'type' => TType::STRING,
          ),
        3 => array(
          'var' => 'tableType',
          'type' => TType::STRING,
          ),
        4 => array(
          'var' => 'comments',
          'type' => TType::STRING,
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['dbName'])) {
        $this->dbName = $vals['dbName'];
      }
      if (isset($vals['tableName'])) {
        $this->tableName = $vals['tableName'];
      }
      if (isset($vals['tableType'])) {
        $this->tableType = $vals['tableType'];
      }
      if (isset($vals['comments'])) {
        $this->comments = $vals['comments'];
      }
    }
  }

  public function getName() {
    return 'TableMeta';
  }

  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->dbName);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 2:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->tableName);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 3:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->tableType);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 4:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->comments);
          } 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('TableMeta');
    if ($this->dbName !== null) {
      $xfer += $output->writeFieldBegin('dbName', TType::STRING, 1);
      $xfer += $output->writeString($this->dbName);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->tableName !== null) {
      $xfer += $output->writeFieldBegin('tableName', TType::STRING, 2);
      $xfer += $output->writeString($this->tableName);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->tableType !== null) {
      $xfer += $output->writeFieldBegin('tableType', TType::STRING, 3);
      $xfer += $output->writeString($this->tableType);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->comments !== null) {
      $xfer += $output->writeFieldBegin('comments', TType::STRING, 4);
      $xfer += $output->writeString($this->comments);
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class MetaException extends TException {
  static $_TSPEC;

  /**
   * @var string
   */
  public $message = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'message',
          'type' => TType::STRING,
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['message'])) {
        $this->message = $vals['message'];
      }
    }
  }

  public function getName() {
    return 'MetaException';
  }

  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->message);
          } 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('MetaException');
    if ($this->message !== null) {
      $xfer += $output->writeFieldBegin('message', TType::STRING, 1);
      $xfer += $output->writeString($this->message);
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class UnknownTableException extends TException {
  static $_TSPEC;

  /**
   * @var string
   */
  public $message = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'message',
          'type' => TType::STRING,
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['message'])) {
        $this->message = $vals['message'];
      }
    }
  }

  public function getName() {
    return 'UnknownTableException';
  }

  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->message);
          } 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('UnknownTableException');
    if ($this->message !== null) {
      $xfer += $output->writeFieldBegin('message', TType::STRING, 1);
      $xfer += $output->writeString($this->message);
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class UnknownDBException extends TException {
  static $_TSPEC;

  /**
   * @var string
   */
  public $message = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'message',
          'type' => TType::STRING,
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['message'])) {
        $this->message = $vals['message'];
      }
    }
  }

  public function getName() {
    return 'UnknownDBException';
  }

  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->message);
          } 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('UnknownDBException');
    if ($this->message !== null) {
      $xfer += $output->writeFieldBegin('message', TType::STRING, 1);
      $xfer += $output->writeString($this->message);
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class AlreadyExistsException extends TException {
  static $_TSPEC;

  /**
   * @var string
   */
  public $message = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'message',
          'type' => TType::STRING,
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['message'])) {
        $this->message = $vals['message'];
      }
    }
  }

  public function getName() {
    return 'AlreadyExistsException';
  }

  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->message);
          } 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('AlreadyExistsException');
    if ($this->message !== null) {
      $xfer += $output->writeFieldBegin('message', TType::STRING, 1);
      $xfer += $output->writeString($this->message);
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class InvalidPartitionException extends TException {
  static $_TSPEC;

  /**
   * @var string
   */
  public $message = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'message',
          'type' => TType::STRING,
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['message'])) {
        $this->message = $vals['message'];
      }
    }
  }

  public function getName() {
    return 'InvalidPartitionException';
  }

  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->message);
          } 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('InvalidPartitionException');
    if ($this->message !== null) {
      $xfer += $output->writeFieldBegin('message', TType::STRING, 1);
      $xfer += $output->writeString($this->message);
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class UnknownPartitionException extends TException {
  static $_TSPEC;

  /**
   * @var string
   */
  public $message = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'message',
          'type' => TType::STRING,
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['message'])) {
        $this->message = $vals['message'];
      }
    }
  }

  public function getName() {
    return 'UnknownPartitionException';
  }

  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->message);
          } 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('UnknownPartitionException');
    if ($this->message !== null) {
      $xfer += $output->writeFieldBegin('message', TType::STRING, 1);
      $xfer += $output->writeString($this->message);
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class InvalidObjectException extends TException {
  static $_TSPEC;

  /**
   * @var string
   */
  public $message = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'message',
          'type' => TType::STRING,
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['message'])) {
        $this->message = $vals['message'];
      }
    }
  }

  public function getName() {
    return 'InvalidObjectException';
  }

  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->message);
          } 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('InvalidObjectException');
    if ($this->message !== null) {
      $xfer += $output->writeFieldBegin('message', TType::STRING, 1);
      $xfer += $output->writeString($this->message);
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class NoSuchObjectException extends TException {
  static $_TSPEC;

  /**
   * @var string
   */
  public $message = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'message',
          'type' => TType::STRING,
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['message'])) {
        $this->message = $vals['message'];
      }
    }
  }

  public function getName() {
    return 'NoSuchObjectException';
  }

  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->message);
          } 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('NoSuchObjectException');
    if ($this->message !== null) {
      $xfer += $output->writeFieldBegin('message', TType::STRING, 1);
      $xfer += $output->writeString($this->message);
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class IndexAlreadyExistsException extends TException {
  static $_TSPEC;

  /**
   * @var string
   */
  public $message = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'message',
          'type' => TType::STRING,
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['message'])) {
        $this->message = $vals['message'];
      }
    }
  }

  public function getName() {
    return 'IndexAlreadyExistsException';
  }

  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->message);
          } 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('IndexAlreadyExistsException');
    if ($this->message !== null) {
      $xfer += $output->writeFieldBegin('message', TType::STRING, 1);
      $xfer += $output->writeString($this->message);
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class InvalidOperationException extends TException {
  static $_TSPEC;

  /**
   * @var string
   */
  public $message = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'message',
          'type' => TType::STRING,
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['message'])) {
        $this->message = $vals['message'];
      }
    }
  }

  public function getName() {
    return 'InvalidOperationException';
  }

  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->message);
          } 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('InvalidOperationException');
    if ($this->message !== null) {
      $xfer += $output->writeFieldBegin('message', TType::STRING, 1);
      $xfer += $output->writeString($this->message);
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class ConfigValSecurityException extends TException {
  static $_TSPEC;

  /**
   * @var string
   */
  public $message = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'message',
          'type' => TType::STRING,
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['message'])) {
        $this->message = $vals['message'];
      }
    }
  }

  public function getName() {
    return 'ConfigValSecurityException';
  }

  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->message);
          } 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('ConfigValSecurityException');
    if ($this->message !== null) {
      $xfer += $output->writeFieldBegin('message', TType::STRING, 1);
      $xfer += $output->writeString($this->message);
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class InvalidInputException extends TException {
  static $_TSPEC;

  /**
   * @var string
   */
  public $message = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'message',
          'type' => TType::STRING,
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['message'])) {
        $this->message = $vals['message'];
      }
    }
  }

  public function getName() {
    return 'InvalidInputException';
  }

  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->message);
          } 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('InvalidInputException');
    if ($this->message !== null) {
      $xfer += $output->writeFieldBegin('message', TType::STRING, 1);
      $xfer += $output->writeString($this->message);
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class NoSuchTxnException extends TException {
  static $_TSPEC;

  /**
   * @var string
   */
  public $message = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'message',
          'type' => TType::STRING,
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['message'])) {
        $this->message = $vals['message'];
      }
    }
  }

  public function getName() {
    return 'NoSuchTxnException';
  }

  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->message);
          } 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('NoSuchTxnException');
    if ($this->message !== null) {
      $xfer += $output->writeFieldBegin('message', TType::STRING, 1);
      $xfer += $output->writeString($this->message);
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class TxnAbortedException extends TException {
  static $_TSPEC;

  /**
   * @var string
   */
  public $message = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'message',
          'type' => TType::STRING,
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['message'])) {
        $this->message = $vals['message'];
      }
    }
  }

  public function getName() {
    return 'TxnAbortedException';
  }

  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->message);
          } 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('TxnAbortedException');
    if ($this->message !== null) {
      $xfer += $output->writeFieldBegin('message', TType::STRING, 1);
      $xfer += $output->writeString($this->message);
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class TxnOpenException extends TException {
  static $_TSPEC;

  /**
   * @var string
   */
  public $message = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'message',
          'type' => TType::STRING,
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['message'])) {
        $this->message = $vals['message'];
      }
    }
  }

  public function getName() {
    return 'TxnOpenException';
  }

  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->message);
          } 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('TxnOpenException');
    if ($this->message !== null) {
      $xfer += $output->writeFieldBegin('message', TType::STRING, 1);
      $xfer += $output->writeString($this->message);
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class NoSuchLockException extends TException {
  static $_TSPEC;

  /**
   * @var string
   */
  public $message = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'message',
          'type' => TType::STRING,
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['message'])) {
        $this->message = $vals['message'];
      }
    }
  }

  public function getName() {
    return 'NoSuchLockException';
  }

  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->message);
          } 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('NoSuchLockException');
    if ($this->message !== null) {
      $xfer += $output->writeFieldBegin('message', TType::STRING, 1);
      $xfer += $output->writeString($this->message);
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

final class Constant extends \Thrift\Type\TConstant {
  static protected $DDL_TIME;
  static protected $HIVE_FILTER_FIELD_OWNER;
  static protected $HIVE_FILTER_FIELD_PARAMS;
  static protected $HIVE_FILTER_FIELD_LAST_ACCESS;
  static protected $IS_ARCHIVED;
  static protected $ORIGINAL_LOCATION;
  static protected $IS_IMMUTABLE;
  static protected $META_TABLE_COLUMNS;
  static protected $META_TABLE_COLUMN_TYPES;
  static protected $BUCKET_FIELD_NAME;
  static protected $BUCKET_COUNT;
  static protected $FIELD_TO_DIMENSION;
  static protected $META_TABLE_NAME;
  static protected $META_TABLE_DB;
  static protected $META_TABLE_LOCATION;
  static protected $META_TABLE_SERDE;
  static protected $META_TABLE_PARTITION_COLUMNS;
  static protected $META_TABLE_PARTITION_COLUMN_TYPES;
  static protected $FILE_INPUT_FORMAT;
  static protected $FILE_OUTPUT_FORMAT;
  static protected $META_TABLE_STORAGE;
  static protected $TABLE_IS_TRANSACTIONAL;
  static protected $TABLE_NO_AUTO_COMPACT;
  static protected $TABLE_TRANSACTIONAL_PROPERTIES;

  static protected function init_DDL_TIME() {
    return "transient_lastDdlTime";
  }

  static protected function init_HIVE_FILTER_FIELD_OWNER() {
    return "hive_filter_field_owner__";
  }

  static protected function init_HIVE_FILTER_FIELD_PARAMS() {
    return "hive_filter_field_params__";
  }

  static protected function init_HIVE_FILTER_FIELD_LAST_ACCESS() {
    return "hive_filter_field_last_access__";
  }

  static protected function init_IS_ARCHIVED() {
    return "is_archived";
  }

  static protected function init_ORIGINAL_LOCATION() {
    return "original_location";
  }

  static protected function init_IS_IMMUTABLE() {
    return "immutable";
  }

  static protected function init_META_TABLE_COLUMNS() {
    return "columns";
  }

  static protected function init_META_TABLE_COLUMN_TYPES() {
    return "columns.types";
  }

  static protected function init_BUCKET_FIELD_NAME() {
    return "bucket_field_name";
  }

  static protected function init_BUCKET_COUNT() {
    return "bucket_count";
  }

  static protected function init_FIELD_TO_DIMENSION() {
    return "field_to_dimension";
  }

  static protected function init_META_TABLE_NAME() {
    return "name";
  }

  static protected function init_META_TABLE_DB() {
    return "db";
  }

  static protected function init_META_TABLE_LOCATION() {
    return "location";
  }

  static protected function init_META_TABLE_SERDE() {
    return "serde";
  }

  static protected function init_META_TABLE_PARTITION_COLUMNS() {
    return "partition_columns";
  }

  static protected function init_META_TABLE_PARTITION_COLUMN_TYPES() {
    return "partition_columns.types";
  }

  static protected function init_FILE_INPUT_FORMAT() {
    return "file.inputformat";
  }

  static protected function init_FILE_OUTPUT_FORMAT() {
    return "file.outputformat";
  }

  static protected function init_META_TABLE_STORAGE() {
    return "storage_handler";
  }

  static protected function init_TABLE_IS_TRANSACTIONAL() {
    return "transactional";
  }

  static protected function init_TABLE_NO_AUTO_COMPACT() {
    return "no_auto_compaction";
  }

  static protected function init_TABLE_TRANSACTIONAL_PROPERTIES() {
    return "transactional_properties";
  }
}


