Пример #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::STRING) {
                     $xfer += $input->readString($this->tableName);
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             case 2:
                 if ($ftype == TType::STRUCT) {
                     $this->scan = new \Hbase\TScan();
                     $xfer += $this->scan->read($input);
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             case 3:
                 if ($ftype == TType::MAP) {
                     $this->attributes = array();
                     $_size413 = 0;
                     $_ktype414 = 0;
                     $_vtype415 = 0;
                     $xfer += $input->readMapBegin($_ktype414, $_vtype415, $_size413);
                     for ($_i417 = 0; $_i417 < $_size413; ++$_i417) {
                         $key418 = '';
                         $val419 = '';
                         $xfer += $input->readString($key418);
                         $xfer += $input->readString($val419);
                         $this->attributes[$key418] = $val419;
                     }
                     $xfer += $input->readMapEnd();
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             default:
                 $xfer += $input->skip($ftype);
                 break;
         }
         $xfer += $input->readFieldEnd();
     }
     $xfer += $input->readStructEnd();
     return $xfer;
 }
Пример #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::STRING) {
                     $xfer += $input->readString($this->tableName);
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             case 2:
                 if ($ftype == TType::STRUCT) {
                     $this->scan = new \Hbase\TScan();
                     $xfer += $this->scan->read($input);
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             case 3:
                 if ($ftype == TType::MAP) {
                     $this->attributes = array();
                     $_size399 = 0;
                     $_ktype400 = 0;
                     $_vtype401 = 0;
                     $xfer += $input->readMapBegin($_ktype400, $_vtype401, $_size399);
                     for ($_i403 = 0; $_i403 < $_size399; ++$_i403) {
                         $key404 = '';
                         $val405 = '';
                         $xfer += $input->readString($key404);
                         $xfer += $input->readString($val405);
                         $this->attributes[$key404] = $val405;
                     }
                     $xfer += $input->readMapEnd();
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             default:
                 $xfer += $input->skip($ftype);
                 break;
         }
         $xfer += $input->readFieldEnd();
     }
     $xfer += $input->readStructEnd();
     return $xfer;
 }