<?php
namespace metastore;

/**
 * Autogenerated by Thrift Compiler (0.16.0)
 *
 * 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;

class ShowCompactResponseElement
{
    static public $isValidate = false;

    static public $_TSPEC = array(
        1 => array(
            'var' => 'dbname',
            'isRequired' => true,
            'type' => TType::STRING,
        ),
        2 => array(
            'var' => 'tablename',
            'isRequired' => true,
            'type' => TType::STRING,
        ),
        3 => array(
            'var' => 'partitionname',
            'isRequired' => false,
            'type' => TType::STRING,
        ),
        4 => array(
            'var' => 'type',
            'isRequired' => true,
            'type' => TType::I32,
            'class' => '\metastore\CompactionType',
        ),
        5 => array(
            'var' => 'state',
            'isRequired' => true,
            'type' => TType::STRING,
        ),
        6 => array(
            'var' => 'workerid',
            'isRequired' => false,
            'type' => TType::STRING,
        ),
        7 => array(
            'var' => 'start',
            'isRequired' => false,
            'type' => TType::I64,
        ),
        8 => array(
            'var' => 'runAs',
            'isRequired' => false,
            'type' => TType::STRING,
        ),
        9 => array(
            'var' => 'hightestTxnId',
            'isRequired' => false,
            'type' => TType::I64,
        ),
        10 => array(
            'var' => 'metaInfo',
            'isRequired' => false,
            'type' => TType::STRING,
        ),
        11 => array(
            'var' => 'endTime',
            'isRequired' => false,
            'type' => TType::I64,
        ),
        12 => array(
            'var' => 'hadoopJobId',
            'isRequired' => false,
            'type' => TType::STRING,
        ),
        13 => array(
            'var' => 'id',
            'isRequired' => false,
            'type' => TType::I64,
        ),
        14 => array(
            'var' => 'errorMessage',
            'isRequired' => false,
            'type' => TType::STRING,
        ),
        15 => array(
            'var' => 'enqueueTime',
            'isRequired' => false,
            'type' => TType::I64,
        ),
        16 => array(
            'var' => 'workerVersion',
            'isRequired' => false,
            'type' => TType::STRING,
        ),
        17 => array(
            'var' => 'initiatorId',
            'isRequired' => false,
            'type' => TType::STRING,
        ),
        18 => array(
            'var' => 'initiatorVersion',
            'isRequired' => false,
            'type' => TType::STRING,
        ),
        19 => array(
            'var' => 'cleanerStart',
            'isRequired' => false,
            'type' => TType::I64,
        ),
        20 => array(
            'var' => 'poolName',
            'isRequired' => false,
            'type' => TType::STRING,
        ),
        21 => array(
            'var' => 'nextTxnId',
            'isRequired' => false,
            'type' => TType::I64,
        ),
        22 => array(
            'var' => 'txnId',
            'isRequired' => false,
            'type' => TType::I64,
        ),
        23 => array(
            'var' => 'commitTime',
            'isRequired' => false,
            'type' => TType::I64,
        ),
        24 => array(
            'var' => 'hightestWriteId',
            'isRequired' => false,
            'type' => TType::I64,
        ),
    );

    /**
     * @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;
    /**
     * @var string
     */
    public $errorMessage = null;
    /**
     * @var int
     */
    public $enqueueTime = null;
    /**
     * @var string
     */
    public $workerVersion = null;
    /**
     * @var string
     */
    public $initiatorId = null;
    /**
     * @var string
     */
    public $initiatorVersion = null;
    /**
     * @var int
     */
    public $cleanerStart = null;
    /**
     * @var string
     */
    public $poolName = null;
    /**
     * @var int
     */
    public $nextTxnId = null;
    /**
     * @var int
     */
    public $txnId = null;
    /**
     * @var int
     */
    public $commitTime = null;
    /**
     * @var int
     */
    public $hightestWriteId = null;

    public function __construct($vals = null)
    {
        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'];
            }
            if (isset($vals['errorMessage'])) {
                $this->errorMessage = $vals['errorMessage'];
            }
            if (isset($vals['enqueueTime'])) {
                $this->enqueueTime = $vals['enqueueTime'];
            }
            if (isset($vals['workerVersion'])) {
                $this->workerVersion = $vals['workerVersion'];
            }
            if (isset($vals['initiatorId'])) {
                $this->initiatorId = $vals['initiatorId'];
            }
            if (isset($vals['initiatorVersion'])) {
                $this->initiatorVersion = $vals['initiatorVersion'];
            }
            if (isset($vals['cleanerStart'])) {
                $this->cleanerStart = $vals['cleanerStart'];
            }
            if (isset($vals['poolName'])) {
                $this->poolName = $vals['poolName'];
            }
            if (isset($vals['nextTxnId'])) {
                $this->nextTxnId = $vals['nextTxnId'];
            }
            if (isset($vals['txnId'])) {
                $this->txnId = $vals['txnId'];
            }
            if (isset($vals['commitTime'])) {
                $this->commitTime = $vals['commitTime'];
            }
            if (isset($vals['hightestWriteId'])) {
                $this->hightestWriteId = $vals['hightestWriteId'];
            }
        }
    }

    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;
                case 14:
                    if ($ftype == TType::STRING) {
                        $xfer += $input->readString($this->errorMessage);
                    } else {
                        $xfer += $input->skip($ftype);
                    }
                    break;
                case 15:
                    if ($ftype == TType::I64) {
                        $xfer += $input->readI64($this->enqueueTime);
                    } else {
                        $xfer += $input->skip($ftype);
                    }
                    break;
                case 16:
                    if ($ftype == TType::STRING) {
                        $xfer += $input->readString($this->workerVersion);
                    } else {
                        $xfer += $input->skip($ftype);
                    }
                    break;
                case 17:
                    if ($ftype == TType::STRING) {
                        $xfer += $input->readString($this->initiatorId);
                    } else {
                        $xfer += $input->skip($ftype);
                    }
                    break;
                case 18:
                    if ($ftype == TType::STRING) {
                        $xfer += $input->readString($this->initiatorVersion);
                    } else {
                        $xfer += $input->skip($ftype);
                    }
                    break;
                case 19:
                    if ($ftype == TType::I64) {
                        $xfer += $input->readI64($this->cleanerStart);
                    } else {
                        $xfer += $input->skip($ftype);
                    }
                    break;
                case 20:
                    if ($ftype == TType::STRING) {
                        $xfer += $input->readString($this->poolName);
                    } else {
                        $xfer += $input->skip($ftype);
                    }
                    break;
                case 21:
                    if ($ftype == TType::I64) {
                        $xfer += $input->readI64($this->nextTxnId);
                    } else {
                        $xfer += $input->skip($ftype);
                    }
                    break;
                case 22:
                    if ($ftype == TType::I64) {
                        $xfer += $input->readI64($this->txnId);
                    } else {
                        $xfer += $input->skip($ftype);
                    }
                    break;
                case 23:
                    if ($ftype == TType::I64) {
                        $xfer += $input->readI64($this->commitTime);
                    } else {
                        $xfer += $input->skip($ftype);
                    }
                    break;
                case 24:
                    if ($ftype == TType::I64) {
                        $xfer += $input->readI64($this->hightestWriteId);
                    } 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();
        }
        if ($this->errorMessage !== null) {
            $xfer += $output->writeFieldBegin('errorMessage', TType::STRING, 14);
            $xfer += $output->writeString($this->errorMessage);
            $xfer += $output->writeFieldEnd();
        }
        if ($this->enqueueTime !== null) {
            $xfer += $output->writeFieldBegin('enqueueTime', TType::I64, 15);
            $xfer += $output->writeI64($this->enqueueTime);
            $xfer += $output->writeFieldEnd();
        }
        if ($this->workerVersion !== null) {
            $xfer += $output->writeFieldBegin('workerVersion', TType::STRING, 16);
            $xfer += $output->writeString($this->workerVersion);
            $xfer += $output->writeFieldEnd();
        }
        if ($this->initiatorId !== null) {
            $xfer += $output->writeFieldBegin('initiatorId', TType::STRING, 17);
            $xfer += $output->writeString($this->initiatorId);
            $xfer += $output->writeFieldEnd();
        }
        if ($this->initiatorVersion !== null) {
            $xfer += $output->writeFieldBegin('initiatorVersion', TType::STRING, 18);
            $xfer += $output->writeString($this->initiatorVersion);
            $xfer += $output->writeFieldEnd();
        }
        if ($this->cleanerStart !== null) {
            $xfer += $output->writeFieldBegin('cleanerStart', TType::I64, 19);
            $xfer += $output->writeI64($this->cleanerStart);
            $xfer += $output->writeFieldEnd();
        }
        if ($this->poolName !== null) {
            $xfer += $output->writeFieldBegin('poolName', TType::STRING, 20);
            $xfer += $output->writeString($this->poolName);
            $xfer += $output->writeFieldEnd();
        }
        if ($this->nextTxnId !== null) {
            $xfer += $output->writeFieldBegin('nextTxnId', TType::I64, 21);
            $xfer += $output->writeI64($this->nextTxnId);
            $xfer += $output->writeFieldEnd();
        }
        if ($this->txnId !== null) {
            $xfer += $output->writeFieldBegin('txnId', TType::I64, 22);
            $xfer += $output->writeI64($this->txnId);
            $xfer += $output->writeFieldEnd();
        }
        if ($this->commitTime !== null) {
            $xfer += $output->writeFieldBegin('commitTime', TType::I64, 23);
            $xfer += $output->writeI64($this->commitTime);
            $xfer += $output->writeFieldEnd();
        }
        if ($this->hightestWriteId !== null) {
            $xfer += $output->writeFieldBegin('hightestWriteId', TType::I64, 24);
            $xfer += $output->writeI64($this->hightestWriteId);
            $xfer += $output->writeFieldEnd();
        }
        $xfer += $output->writeFieldStop();
        $xfer += $output->writeStructEnd();
        return $xfer;
    }
}
