コード例 #1
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 0:
                 if ($ftype == TType::LST) {
                     $this->success = array();
                     $_size32 = 0;
                     $_etype35 = 0;
                     $xfer += $input->readListBegin($_etype35, $_size32);
                     for ($_i36 = 0; $_i36 < $_size32; ++$_i36) {
                         $elem37 = null;
                         $elem37 = new TRegionInfo();
                         $xfer += $elem37->read($input);
                         $this->success[] = $elem37;
                     }
                     $xfer += $input->readListEnd();
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             case 1:
                 if ($ftype == TType::STRUCT) {
                     $this->io = new IOError();
                     $xfer += $this->io->read($input);
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             default:
                 $xfer += $input->skip($ftype);
                 break;
         }
         $xfer += $input->readFieldEnd();
     }
     $xfer += $input->readStructEnd();
     return $xfer;
 }
コード例 #2
0
ファイル: Hbase_types.php プロジェクト: victory2015/biglaw
 public function __construct($vals = null)
 {
     if (!isset(self::$_TSPEC)) {
         self::$_TSPEC = array(1 => array('var' => 'startKey', 'type' => TType::STRING), 2 => array('var' => 'endKey', 'type' => TType::STRING), 3 => array('var' => 'id', 'type' => TType::I64), 4 => array('var' => 'name', 'type' => TType::STRING), 5 => array('var' => 'version', 'type' => TType::BYTE));
     }
     if (is_array($vals)) {
         if (isset($vals['startKey'])) {
             $this->startKey = $vals['startKey'];
         }
         if (isset($vals['endKey'])) {
             $this->endKey = $vals['endKey'];
         }
         if (isset($vals['id'])) {
             $this->id = $vals['id'];
         }
         if (isset($vals['name'])) {
             $this->name = $vals['name'];
         }
         if (isset($vals['version'])) {
             $this->version = $vals['version'];
         }
     }
 }