Esempio n. 1
0
 public function __construct($vals = null)
 {
     if (!isset(self::$_TSPEC)) {
         self::$_TSPEC = array(1 => array('var' => 'minStamp', 'type' => TType::I64), 2 => array('var' => 'maxStamp', 'type' => TType::I64));
     }
     if (is_array($vals)) {
         if (isset($vals['minStamp'])) {
             $this->minStamp = $vals['minStamp'];
         }
         if (isset($vals['maxStamp'])) {
             $this->maxStamp = $vals['maxStamp'];
         }
     }
 }
Esempio n. 2
0
 public function write($output)
 {
     $xfer = 0;
     $xfer += $output->writeStructBegin('TScan');
     if ($this->startRow !== null) {
         $xfer += $output->writeFieldBegin('startRow', TType::STRING, 1);
         $xfer += $output->writeString($this->startRow);
         $xfer += $output->writeFieldEnd();
     }
     if ($this->stopRow !== null) {
         $xfer += $output->writeFieldBegin('stopRow', TType::STRING, 2);
         $xfer += $output->writeString($this->stopRow);
         $xfer += $output->writeFieldEnd();
     }
     if ($this->columns !== null) {
         if (!is_array($this->columns)) {
             throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
         }
         $xfer += $output->writeFieldBegin('columns', TType::LST, 3);
         $output->writeListBegin(TType::STRUCT, count($this->columns));
         foreach ($this->columns as $iter75) {
             $xfer += $iter75->write($output);
         }
         $output->writeListEnd();
         $xfer += $output->writeFieldEnd();
     }
     if ($this->caching !== null) {
         $xfer += $output->writeFieldBegin('caching', TType::I32, 4);
         $xfer += $output->writeI32($this->caching);
         $xfer += $output->writeFieldEnd();
     }
     if ($this->maxVersions !== null) {
         $xfer += $output->writeFieldBegin('maxVersions', TType::I32, 5);
         $xfer += $output->writeI32($this->maxVersions);
         $xfer += $output->writeFieldEnd();
     }
     if ($this->timeRange !== null) {
         if (!is_object($this->timeRange)) {
             throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
         }
         $xfer += $output->writeFieldBegin('timeRange', TType::STRUCT, 6);
         $xfer += $this->timeRange->write($output);
         $xfer += $output->writeFieldEnd();
     }
     if ($this->filterString !== null) {
         $xfer += $output->writeFieldBegin('filterString', TType::STRING, 7);
         $xfer += $output->writeString($this->filterString);
         $xfer += $output->writeFieldEnd();
     }
     if ($this->batchSize !== null) {
         $xfer += $output->writeFieldBegin('batchSize', TType::I32, 8);
         $xfer += $output->writeI32($this->batchSize);
         $xfer += $output->writeFieldEnd();
     }
     if ($this->attributes !== null) {
         if (!is_array($this->attributes)) {
             throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
         }
         $xfer += $output->writeFieldBegin('attributes', TType::MAP, 9);
         $output->writeMapBegin(TType::STRING, TType::STRING, count($this->attributes));
         foreach ($this->attributes as $kiter76 => $viter77) {
             $xfer += $output->writeString($kiter76);
             $xfer += $output->writeString($viter77);
         }
         $output->writeMapEnd();
         $xfer += $output->writeFieldEnd();
     }
     $xfer += $output->writeFieldStop();
     $xfer += $output->writeStructEnd();
     return $xfer;
 }