Ejemplo n.º 1
0
 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->runtime = new \CroutonThrift\Runtime();
                     $xfer += $this->runtime->read($input);
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             case 3:
                 if ($ftype == TType::LST) {
                     $this->span_records = array();
                     $_size28 = 0;
                     $_etype31 = 0;
                     $xfer += $input->readListBegin($_etype31, $_size28);
                     for ($_i32 = 0; $_i32 < $_size28; ++$_i32) {
                         $elem33 = null;
                         $elem33 = new \CroutonThrift\SpanRecord();
                         $xfer += $elem33->read($input);
                         $this->span_records[] = $elem33;
                     }
                     $xfer += $input->readListEnd();
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             case 4:
                 if ($ftype == TType::LST) {
                     $this->log_records = array();
                     $_size34 = 0;
                     $_etype37 = 0;
                     $xfer += $input->readListBegin($_etype37, $_size34);
                     for ($_i38 = 0; $_i38 < $_size34; ++$_i38) {
                         $elem39 = null;
                         $elem39 = new \CroutonThrift\LogRecord();
                         $xfer += $elem39->read($input);
                         $this->log_records[] = $elem39;
                     }
                     $xfer += $input->readListEnd();
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             case 5:
                 if ($ftype == TType::I64) {
                     $xfer += $input->readI64($this->timestamp_offset_micros);
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             case 7:
                 if ($ftype == TType::I64) {
                     $xfer += $input->readI64($this->oldest_micros);
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             case 8:
                 if ($ftype == TType::I64) {
                     $xfer += $input->readI64($this->youngest_micros);
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             case 9:
                 if ($ftype == TType::LST) {
                     $this->counters = array();
                     $_size40 = 0;
                     $_etype43 = 0;
                     $xfer += $input->readListBegin($_etype43, $_size40);
                     for ($_i44 = 0; $_i44 < $_size40; ++$_i44) {
                         $elem45 = null;
                         $elem45 = new \CroutonThrift\NamedCounter();
                         $xfer += $elem45->read($input);
                         $this->counters[] = $elem45;
                     }
                     $xfer += $input->readListEnd();
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             default:
                 $xfer += $input->skip($ftype);
                 break;
         }
         $xfer += $input->readFieldEnd();
     }
     $xfer += $input->readStructEnd();
     return $xfer;
 }
Ejemplo n.º 2
0
 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->runtime = new \CroutonThrift\Runtime();
                     $xfer += $this->runtime->read($input);
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             case 3:
                 if ($ftype == TType::LST) {
                     $this->span_records = array();
                     $_size35 = 0;
                     $_etype38 = 0;
                     $xfer += $input->readListBegin($_etype38, $_size35);
                     for ($_i39 = 0; $_i39 < $_size35; ++$_i39) {
                         $elem40 = null;
                         $elem40 = new \CroutonThrift\SpanRecord();
                         $xfer += $elem40->read($input);
                         $this->span_records[] = $elem40;
                     }
                     $xfer += $input->readListEnd();
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             case 4:
                 if ($ftype == TType::LST) {
                     $this->log_records = array();
                     $_size41 = 0;
                     $_etype44 = 0;
                     $xfer += $input->readListBegin($_etype44, $_size41);
                     for ($_i45 = 0; $_i45 < $_size41; ++$_i45) {
                         $elem46 = null;
                         $elem46 = new \CroutonThrift\LogRecord();
                         $xfer += $elem46->read($input);
                         $this->log_records[] = $elem46;
                     }
                     $xfer += $input->readListEnd();
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             case 5:
                 if ($ftype == TType::I64) {
                     $xfer += $input->readI64($this->timestamp_offset_micros);
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             case 7:
                 if ($ftype == TType::I64) {
                     $xfer += $input->readI64($this->oldest_micros);
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             case 8:
                 if ($ftype == TType::I64) {
                     $xfer += $input->readI64($this->youngest_micros);
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             case 9:
                 if ($ftype == TType::LST) {
                     $this->counters = array();
                     $_size47 = 0;
                     $_etype50 = 0;
                     $xfer += $input->readListBegin($_etype50, $_size47);
                     for ($_i51 = 0; $_i51 < $_size47; ++$_i51) {
                         $elem52 = null;
                         $elem52 = new \CroutonThrift\NamedCounter();
                         $xfer += $elem52->read($input);
                         $this->counters[] = $elem52;
                     }
                     $xfer += $input->readListEnd();
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             default:
                 $xfer += $input->skip($ftype);
                 break;
         }
         $xfer += $input->readFieldEnd();
     }
     $xfer += $input->readStructEnd();
     return $xfer;
 }