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::MAP) {
                     $this->userPrivileges = array();
                     $_size14 = 0;
                     $_ktype15 = 0;
                     $_vtype16 = 0;
                     $xfer += $input->readMapBegin($_ktype15, $_vtype16, $_size14);
                     for ($_i18 = 0; $_i18 < $_size14; ++$_i18) {
                         $key19 = '';
                         $val20 = array();
                         $xfer += $input->readString($key19);
                         $val20 = array();
                         $_size21 = 0;
                         $_etype24 = 0;
                         $xfer += $input->readListBegin($_etype24, $_size21);
                         for ($_i25 = 0; $_i25 < $_size21; ++$_i25) {
                             $elem26 = null;
                             $elem26 = new \metastore\PrivilegeGrantInfo();
                             $xfer += $elem26->read($input);
                             $val20[] = $elem26;
                         }
                         $xfer += $input->readListEnd();
                         $this->userPrivileges[$key19] = $val20;
                     }
                     $xfer += $input->readMapEnd();
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             case 2:
                 if ($ftype == TType::MAP) {
                     $this->groupPrivileges = array();
                     $_size27 = 0;
                     $_ktype28 = 0;
                     $_vtype29 = 0;
                     $xfer += $input->readMapBegin($_ktype28, $_vtype29, $_size27);
                     for ($_i31 = 0; $_i31 < $_size27; ++$_i31) {
                         $key32 = '';
                         $val33 = array();
                         $xfer += $input->readString($key32);
                         $val33 = array();
                         $_size34 = 0;
                         $_etype37 = 0;
                         $xfer += $input->readListBegin($_etype37, $_size34);
                         for ($_i38 = 0; $_i38 < $_size34; ++$_i38) {
                             $elem39 = null;
                             $elem39 = new \metastore\PrivilegeGrantInfo();
                             $xfer += $elem39->read($input);
                             $val33[] = $elem39;
                         }
                         $xfer += $input->readListEnd();
                         $this->groupPrivileges[$key32] = $val33;
                     }
                     $xfer += $input->readMapEnd();
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             case 3:
                 if ($ftype == TType::MAP) {
                     $this->rolePrivileges = array();
                     $_size40 = 0;
                     $_ktype41 = 0;
                     $_vtype42 = 0;
                     $xfer += $input->readMapBegin($_ktype41, $_vtype42, $_size40);
                     for ($_i44 = 0; $_i44 < $_size40; ++$_i44) {
                         $key45 = '';
                         $val46 = array();
                         $xfer += $input->readString($key45);
                         $val46 = array();
                         $_size47 = 0;
                         $_etype50 = 0;
                         $xfer += $input->readListBegin($_etype50, $_size47);
                         for ($_i51 = 0; $_i51 < $_size47; ++$_i51) {
                             $elem52 = null;
                             $elem52 = new \metastore\PrivilegeGrantInfo();
                             $xfer += $elem52->read($input);
                             $val46[] = $elem52;
                         }
                         $xfer += $input->readListEnd();
                         $this->rolePrivileges[$key45] = $val46;
                     }
                     $xfer += $input->readMapEnd();
                 } 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::MAP) {
                     $this->userPrivileges = array();
                     $_size21 = 0;
                     $_ktype22 = 0;
                     $_vtype23 = 0;
                     $xfer += $input->readMapBegin($_ktype22, $_vtype23, $_size21);
                     for ($_i25 = 0; $_i25 < $_size21; ++$_i25) {
                         $key26 = '';
                         $val27 = array();
                         $xfer += $input->readString($key26);
                         $val27 = array();
                         $_size28 = 0;
                         $_etype31 = 0;
                         $xfer += $input->readListBegin($_etype31, $_size28);
                         for ($_i32 = 0; $_i32 < $_size28; ++$_i32) {
                             $elem33 = null;
                             $elem33 = new \metastore\PrivilegeGrantInfo();
                             $xfer += $elem33->read($input);
                             $val27[] = $elem33;
                         }
                         $xfer += $input->readListEnd();
                         $this->userPrivileges[$key26] = $val27;
                     }
                     $xfer += $input->readMapEnd();
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             case 2:
                 if ($ftype == TType::MAP) {
                     $this->groupPrivileges = array();
                     $_size34 = 0;
                     $_ktype35 = 0;
                     $_vtype36 = 0;
                     $xfer += $input->readMapBegin($_ktype35, $_vtype36, $_size34);
                     for ($_i38 = 0; $_i38 < $_size34; ++$_i38) {
                         $key39 = '';
                         $val40 = array();
                         $xfer += $input->readString($key39);
                         $val40 = array();
                         $_size41 = 0;
                         $_etype44 = 0;
                         $xfer += $input->readListBegin($_etype44, $_size41);
                         for ($_i45 = 0; $_i45 < $_size41; ++$_i45) {
                             $elem46 = null;
                             $elem46 = new \metastore\PrivilegeGrantInfo();
                             $xfer += $elem46->read($input);
                             $val40[] = $elem46;
                         }
                         $xfer += $input->readListEnd();
                         $this->groupPrivileges[$key39] = $val40;
                     }
                     $xfer += $input->readMapEnd();
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             case 3:
                 if ($ftype == TType::MAP) {
                     $this->rolePrivileges = array();
                     $_size47 = 0;
                     $_ktype48 = 0;
                     $_vtype49 = 0;
                     $xfer += $input->readMapBegin($_ktype48, $_vtype49, $_size47);
                     for ($_i51 = 0; $_i51 < $_size47; ++$_i51) {
                         $key52 = '';
                         $val53 = array();
                         $xfer += $input->readString($key52);
                         $val53 = array();
                         $_size54 = 0;
                         $_etype57 = 0;
                         $xfer += $input->readListBegin($_etype57, $_size54);
                         for ($_i58 = 0; $_i58 < $_size54; ++$_i58) {
                             $elem59 = null;
                             $elem59 = new \metastore\PrivilegeGrantInfo();
                             $xfer += $elem59->read($input);
                             $val53[] = $elem59;
                         }
                         $xfer += $input->readListEnd();
                         $this->rolePrivileges[$key52] = $val53;
                     }
                     $xfer += $input->readMapEnd();
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             default:
                 $xfer += $input->skip($ftype);
                 break;
         }
         $xfer += $input->readFieldEnd();
     }
     $xfer += $input->readStructEnd();
     return $xfer;
 }