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); } else { $xfer += $input->skip($ftype); } break; case 2: if ($ftype == TType::LST) { $this->tputs = array(); $_size131 = 0; $_etype134 = 0; $xfer += $input->readListBegin($_etype134, $_size131); for ($_i135 = 0; $_i135 < $_size131; ++$_i135) { $elem136 = null; $elem136 = new \TPut(); $xfer += $elem136->read($input); $this->tputs[] = $elem136; } $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('TMutation'); if ($this->put !== null) { if (!is_object($this->put)) { throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); } $xfer += $output->writeFieldBegin('put', TType::STRUCT, 1); $xfer += $this->put->write($output); $xfer += $output->writeFieldEnd(); } if ($this->deleteSingle !== null) { if (!is_object($this->deleteSingle)) { throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); } $xfer += $output->writeFieldBegin('deleteSingle', TType::STRUCT, 2); $xfer += $this->deleteSingle->write($output); $xfer += $output->writeFieldEnd(); } $xfer += $output->writeFieldStop(); $xfer += $output->writeStructEnd(); return $xfer; }
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); } else { $xfer += $input->skip($ftype); } break; case 2: if ($ftype == TType::LST) { $this->puts = array(); $_size56 = 0; $_etype59 = 0; $xfer += $input->readListBegin($_etype59, $_size56); for ($_i60 = 0; $_i60 < $_size56; ++$_i60) { $elem61 = null; $elem61 = new TPut(); $xfer += $elem61->read($input); $this->puts[] = $elem61; } $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 __construct($vals = null) { if (!isset(self::$_TSPEC)) { self::$_TSPEC = array(1 => array('var' => 'row', 'type' => TType::STRING), 2 => array('var' => 'columnValues', 'type' => TType::LST, 'etype' => TType::STRUCT, 'elem' => array('type' => TType::STRUCT, 'class' => 'TColumnValue')), 3 => array('var' => 'timestamp', 'type' => TType::I64), 4 => array('var' => 'writeToWal', 'type' => TType::BOOL)); } if (is_array($vals)) { if (isset($vals['row'])) { $this->row = $vals['row']; } if (isset($vals['columnValues'])) { $this->columnValues = $vals['columnValues']; } if (isset($vals['timestamp'])) { $this->timestamp = $vals['timestamp']; } if (isset($vals['writeToWal'])) { $this->writeToWal = $vals['writeToWal']; } } }