コード例 #1
0
ファイル: Hbase.php プロジェクト: dalinhuang/andyou
 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::LST) {
                     $this->rowBatches = array();
                     $_size333 = 0;
                     $_etype336 = 0;
                     $xfer += $input->readListBegin($_etype336, $_size333);
                     for ($_i337 = 0; $_i337 < $_size333; ++$_i337) {
                         $elem338 = null;
                         $elem338 = new BatchMutation();
                         $xfer += $elem338->read($input);
                         $this->rowBatches[] = $elem338;
                     }
                     $xfer += $input->readListEnd();
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             case 3:
                 if ($ftype == TType::I64) {
                     $xfer += $input->readI64($this->timestamp);
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             case 4:
                 if ($ftype == TType::MAP) {
                     $this->attributes = array();
                     $_size339 = 0;
                     $_ktype340 = 0;
                     $_vtype341 = 0;
                     $xfer += $input->readMapBegin($_ktype340, $_vtype341, $_size339);
                     for ($_i343 = 0; $_i343 < $_size339; ++$_i343) {
                         $key344 = '';
                         $val345 = '';
                         $xfer += $input->readString($key344);
                         $xfer += $input->readString($val345);
                         $this->attributes[$key344] = $val345;
                     }
                     $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
ファイル: Hbase.php プロジェクト: uohzoaix/hbase-code
 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::LST) {
                     $this->rowBatches = array();
                     $_size200 = 0;
                     $_etype203 = 0;
                     $xfer += $input->readListBegin($_etype203, $_size200);
                     for ($_i204 = 0; $_i204 < $_size200; ++$_i204) {
                         $elem205 = null;
                         $elem205 = new BatchMutation();
                         $xfer += $elem205->read($input);
                         $this->rowBatches[] = $elem205;
                     }
                     $xfer += $input->readListEnd();
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             case 3:
                 if ($ftype == TType::I64) {
                     $xfer += $input->readI64($this->timestamp);
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             default:
                 $xfer += $input->skip($ftype);
                 break;
         }
         $xfer += $input->readFieldEnd();
     }
     $xfer += $input->readStructEnd();
     return $xfer;
 }
コード例 #3
0
ファイル: Hbase.php プロジェクト: quequan/Web
 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::LST) {
                     $this->rowBatches = array();
                     $_size340 = 0;
                     $_etype343 = 0;
                     $xfer += $input->readListBegin($_etype343, $_size340);
                     for ($_i344 = 0; $_i344 < $_size340; ++$_i344) {
                         $elem345 = null;
                         $elem345 = new BatchMutation();
                         $xfer += $elem345->read($input);
                         $this->rowBatches[] = $elem345;
                     }
                     $xfer += $input->readListEnd();
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             case 3:
                 if ($ftype == TType::I64) {
                     $xfer += $input->readI64($this->timestamp);
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             case 4:
                 if ($ftype == TType::MAP) {
                     $this->attributes = array();
                     $_size346 = 0;
                     $_ktype347 = 0;
                     $_vtype348 = 0;
                     $xfer += $input->readMapBegin($_ktype347, $_vtype348, $_size346);
                     for ($_i350 = 0; $_i350 < $_size346; ++$_i350) {
                         $key351 = '';
                         $val352 = '';
                         $xfer += $input->readString($key351);
                         $xfer += $input->readString($val352);
                         $this->attributes[$key351] = $val352;
                     }
                     $xfer += $input->readMapEnd();
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             default:
                 $xfer += $input->skip($ftype);
                 break;
         }
         $xfer += $input->readFieldEnd();
     }
     $xfer += $input->readStructEnd();
     return $xfer;
 }