public function __construct($vals = null)
 {
     if (!isset(self::$_TSPEC)) {
         self::$_TSPEC = array(1 => array('var' => 'taskTrackers', 'type' => TType::I32), 2 => array('var' => 'mapTasks', 'type' => TType::I32), 3 => array('var' => 'reduceTasks', 'type' => TType::I32), 4 => array('var' => 'maxMapTasks', 'type' => TType::I32), 5 => array('var' => 'maxReduceTasks', 'type' => TType::I32), 6 => array('var' => 'state', 'type' => TType::I32));
     }
     if (is_array($vals)) {
         if (isset($vals['taskTrackers'])) {
             $this->taskTrackers = $vals['taskTrackers'];
         }
         if (isset($vals['mapTasks'])) {
             $this->mapTasks = $vals['mapTasks'];
         }
         if (isset($vals['reduceTasks'])) {
             $this->reduceTasks = $vals['reduceTasks'];
         }
         if (isset($vals['maxMapTasks'])) {
             $this->maxMapTasks = $vals['maxMapTasks'];
         }
         if (isset($vals['maxReduceTasks'])) {
             $this->maxReduceTasks = $vals['maxReduceTasks'];
         }
         if (isset($vals['state'])) {
             $this->state = $vals['state'];
         }
     }
 }
Beispiel #2
0
 public function write($output)
 {
     $xfer = 0;
     $xfer += $output->writeStructBegin('ThriftHive_getClusterStatus_result');
     if ($this->success !== null) {
         if (!is_object($this->success)) {
             throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
         }
         $xfer += $output->writeFieldBegin('success', TType::STRUCT, 0);
         $xfer += $this->success->write($output);
         $xfer += $output->writeFieldEnd();
     }
     if ($this->ex !== null) {
         $xfer += $output->writeFieldBegin('ex', TType::STRUCT, 1);
         $xfer += $this->ex->write($output);
         $xfer += $output->writeFieldEnd();
     }
     $xfer += $output->writeFieldStop();
     $xfer += $output->writeStructEnd();
     return $xfer;
 }