/projects/hadoop-1.1.2/src/contrib/thriftfs/gen-php/hadoopfs_types.php

https://gitlab.com/essere.lab.public/qualitas.class-corpus · PHP · 714 lines · 665 code · 44 blank · 5 comment · 125 complexity · ed69de83f1f4a976a253422d1d440720 MD5 · raw file

  1. <?php
  2. /**
  3. * Autogenerated by Thrift
  4. *
  5. * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
  6. */
  7. include_once $GLOBALS['THRIFT_ROOT'].'/Thrift.php';
  8. class ThriftHandle {
  9. static $_TSPEC;
  10. public $id = null;
  11. public function __construct($vals=null) {
  12. if (!isset(self::$_TSPEC)) {
  13. self::$_TSPEC = array(
  14. -1 => array(
  15. 'var' => 'id',
  16. 'type' => TType::I64,
  17. ),
  18. );
  19. }
  20. if (is_array($vals)) {
  21. if (isset($vals['id'])) {
  22. $this->id = $vals['id'];
  23. }
  24. }
  25. }
  26. public function getName() {
  27. return 'ThriftHandle';
  28. }
  29. public function read($input)
  30. {
  31. $xfer = 0;
  32. $fname = null;
  33. $ftype = 0;
  34. $fid = 0;
  35. $xfer += $input->readStructBegin($fname);
  36. while (true)
  37. {
  38. $xfer += $input->readFieldBegin($fname, $ftype, $fid);
  39. if ($ftype == TType::STOP) {
  40. break;
  41. }
  42. switch ($fid)
  43. {
  44. case -1:
  45. if ($ftype == TType::I64) {
  46. $xfer += $input->readI64($this->id);
  47. } else {
  48. $xfer += $input->skip($ftype);
  49. }
  50. break;
  51. default:
  52. $xfer += $input->skip($ftype);
  53. break;
  54. }
  55. $xfer += $input->readFieldEnd();
  56. }
  57. $xfer += $input->readStructEnd();
  58. return $xfer;
  59. }
  60. public function write($output) {
  61. $xfer = 0;
  62. $xfer += $output->writeStructBegin('ThriftHandle');
  63. if ($this->id !== null) {
  64. $xfer += $output->writeFieldBegin('id', TType::I64, -1);
  65. $xfer += $output->writeI64($this->id);
  66. $xfer += $output->writeFieldEnd();
  67. }
  68. $xfer += $output->writeFieldStop();
  69. $xfer += $output->writeStructEnd();
  70. return $xfer;
  71. }
  72. }
  73. class Pathname {
  74. static $_TSPEC;
  75. public $pathname = null;
  76. public function __construct($vals=null) {
  77. if (!isset(self::$_TSPEC)) {
  78. self::$_TSPEC = array(
  79. -1 => array(
  80. 'var' => 'pathname',
  81. 'type' => TType::STRING,
  82. ),
  83. );
  84. }
  85. if (is_array($vals)) {
  86. if (isset($vals['pathname'])) {
  87. $this->pathname = $vals['pathname'];
  88. }
  89. }
  90. }
  91. public function getName() {
  92. return 'Pathname';
  93. }
  94. public function read($input)
  95. {
  96. $xfer = 0;
  97. $fname = null;
  98. $ftype = 0;
  99. $fid = 0;
  100. $xfer += $input->readStructBegin($fname);
  101. while (true)
  102. {
  103. $xfer += $input->readFieldBegin($fname, $ftype, $fid);
  104. if ($ftype == TType::STOP) {
  105. break;
  106. }
  107. switch ($fid)
  108. {
  109. case -1:
  110. if ($ftype == TType::STRING) {
  111. $xfer += $input->readString($this->pathname);
  112. } else {
  113. $xfer += $input->skip($ftype);
  114. }
  115. break;
  116. default:
  117. $xfer += $input->skip($ftype);
  118. break;
  119. }
  120. $xfer += $input->readFieldEnd();
  121. }
  122. $xfer += $input->readStructEnd();
  123. return $xfer;
  124. }
  125. public function write($output) {
  126. $xfer = 0;
  127. $xfer += $output->writeStructBegin('Pathname');
  128. if ($this->pathname !== null) {
  129. $xfer += $output->writeFieldBegin('pathname', TType::STRING, -1);
  130. $xfer += $output->writeString($this->pathname);
  131. $xfer += $output->writeFieldEnd();
  132. }
  133. $xfer += $output->writeFieldStop();
  134. $xfer += $output->writeStructEnd();
  135. return $xfer;
  136. }
  137. }
  138. class FileStatus {
  139. static $_TSPEC;
  140. public $path = null;
  141. public $length = null;
  142. public $isdir = null;
  143. public $block_replication = null;
  144. public $blocksize = null;
  145. public $modification_time = null;
  146. public $permission = null;
  147. public $owner = null;
  148. public $group = null;
  149. public function __construct($vals=null) {
  150. if (!isset(self::$_TSPEC)) {
  151. self::$_TSPEC = array(
  152. 1 => array(
  153. 'var' => 'path',
  154. 'type' => TType::STRING,
  155. ),
  156. 2 => array(
  157. 'var' => 'length',
  158. 'type' => TType::I64,
  159. ),
  160. 3 => array(
  161. 'var' => 'isdir',
  162. 'type' => TType::BOOL,
  163. ),
  164. 4 => array(
  165. 'var' => 'block_replication',
  166. 'type' => TType::I16,
  167. ),
  168. 5 => array(
  169. 'var' => 'blocksize',
  170. 'type' => TType::I64,
  171. ),
  172. 6 => array(
  173. 'var' => 'modification_time',
  174. 'type' => TType::I64,
  175. ),
  176. 7 => array(
  177. 'var' => 'permission',
  178. 'type' => TType::STRING,
  179. ),
  180. 8 => array(
  181. 'var' => 'owner',
  182. 'type' => TType::STRING,
  183. ),
  184. 9 => array(
  185. 'var' => 'group',
  186. 'type' => TType::STRING,
  187. ),
  188. );
  189. }
  190. if (is_array($vals)) {
  191. if (isset($vals['path'])) {
  192. $this->path = $vals['path'];
  193. }
  194. if (isset($vals['length'])) {
  195. $this->length = $vals['length'];
  196. }
  197. if (isset($vals['isdir'])) {
  198. $this->isdir = $vals['isdir'];
  199. }
  200. if (isset($vals['block_replication'])) {
  201. $this->block_replication = $vals['block_replication'];
  202. }
  203. if (isset($vals['blocksize'])) {
  204. $this->blocksize = $vals['blocksize'];
  205. }
  206. if (isset($vals['modification_time'])) {
  207. $this->modification_time = $vals['modification_time'];
  208. }
  209. if (isset($vals['permission'])) {
  210. $this->permission = $vals['permission'];
  211. }
  212. if (isset($vals['owner'])) {
  213. $this->owner = $vals['owner'];
  214. }
  215. if (isset($vals['group'])) {
  216. $this->group = $vals['group'];
  217. }
  218. }
  219. }
  220. public function getName() {
  221. return 'FileStatus';
  222. }
  223. public function read($input)
  224. {
  225. $xfer = 0;
  226. $fname = null;
  227. $ftype = 0;
  228. $fid = 0;
  229. $xfer += $input->readStructBegin($fname);
  230. while (true)
  231. {
  232. $xfer += $input->readFieldBegin($fname, $ftype, $fid);
  233. if ($ftype == TType::STOP) {
  234. break;
  235. }
  236. switch ($fid)
  237. {
  238. case 1:
  239. if ($ftype == TType::STRING) {
  240. $xfer += $input->readString($this->path);
  241. } else {
  242. $xfer += $input->skip($ftype);
  243. }
  244. break;
  245. case 2:
  246. if ($ftype == TType::I64) {
  247. $xfer += $input->readI64($this->length);
  248. } else {
  249. $xfer += $input->skip($ftype);
  250. }
  251. break;
  252. case 3:
  253. if ($ftype == TType::BOOL) {
  254. $xfer += $input->readBool($this->isdir);
  255. } else {
  256. $xfer += $input->skip($ftype);
  257. }
  258. break;
  259. case 4:
  260. if ($ftype == TType::I16) {
  261. $xfer += $input->readI16($this->block_replication);
  262. } else {
  263. $xfer += $input->skip($ftype);
  264. }
  265. break;
  266. case 5:
  267. if ($ftype == TType::I64) {
  268. $xfer += $input->readI64($this->blocksize);
  269. } else {
  270. $xfer += $input->skip($ftype);
  271. }
  272. break;
  273. case 6:
  274. if ($ftype == TType::I64) {
  275. $xfer += $input->readI64($this->modification_time);
  276. } else {
  277. $xfer += $input->skip($ftype);
  278. }
  279. break;
  280. case 7:
  281. if ($ftype == TType::STRING) {
  282. $xfer += $input->readString($this->permission);
  283. } else {
  284. $xfer += $input->skip($ftype);
  285. }
  286. break;
  287. case 8:
  288. if ($ftype == TType::STRING) {
  289. $xfer += $input->readString($this->owner);
  290. } else {
  291. $xfer += $input->skip($ftype);
  292. }
  293. break;
  294. case 9:
  295. if ($ftype == TType::STRING) {
  296. $xfer += $input->readString($this->group);
  297. } else {
  298. $xfer += $input->skip($ftype);
  299. }
  300. break;
  301. default:
  302. $xfer += $input->skip($ftype);
  303. break;
  304. }
  305. $xfer += $input->readFieldEnd();
  306. }
  307. $xfer += $input->readStructEnd();
  308. return $xfer;
  309. }
  310. public function write($output) {
  311. $xfer = 0;
  312. $xfer += $output->writeStructBegin('FileStatus');
  313. if ($this->path !== null) {
  314. $xfer += $output->writeFieldBegin('path', TType::STRING, 1);
  315. $xfer += $output->writeString($this->path);
  316. $xfer += $output->writeFieldEnd();
  317. }
  318. if ($this->length !== null) {
  319. $xfer += $output->writeFieldBegin('length', TType::I64, 2);
  320. $xfer += $output->writeI64($this->length);
  321. $xfer += $output->writeFieldEnd();
  322. }
  323. if ($this->isdir !== null) {
  324. $xfer += $output->writeFieldBegin('isdir', TType::BOOL, 3);
  325. $xfer += $output->writeBool($this->isdir);
  326. $xfer += $output->writeFieldEnd();
  327. }
  328. if ($this->block_replication !== null) {
  329. $xfer += $output->writeFieldBegin('block_replication', TType::I16, 4);
  330. $xfer += $output->writeI16($this->block_replication);
  331. $xfer += $output->writeFieldEnd();
  332. }
  333. if ($this->blocksize !== null) {
  334. $xfer += $output->writeFieldBegin('blocksize', TType::I64, 5);
  335. $xfer += $output->writeI64($this->blocksize);
  336. $xfer += $output->writeFieldEnd();
  337. }
  338. if ($this->modification_time !== null) {
  339. $xfer += $output->writeFieldBegin('modification_time', TType::I64, 6);
  340. $xfer += $output->writeI64($this->modification_time);
  341. $xfer += $output->writeFieldEnd();
  342. }
  343. if ($this->permission !== null) {
  344. $xfer += $output->writeFieldBegin('permission', TType::STRING, 7);
  345. $xfer += $output->writeString($this->permission);
  346. $xfer += $output->writeFieldEnd();
  347. }
  348. if ($this->owner !== null) {
  349. $xfer += $output->writeFieldBegin('owner', TType::STRING, 8);
  350. $xfer += $output->writeString($this->owner);
  351. $xfer += $output->writeFieldEnd();
  352. }
  353. if ($this->group !== null) {
  354. $xfer += $output->writeFieldBegin('group', TType::STRING, 9);
  355. $xfer += $output->writeString($this->group);
  356. $xfer += $output->writeFieldEnd();
  357. }
  358. $xfer += $output->writeFieldStop();
  359. $xfer += $output->writeStructEnd();
  360. return $xfer;
  361. }
  362. }
  363. class BlockLocation {
  364. static $_TSPEC;
  365. public $hosts = null;
  366. public $names = null;
  367. public $offset = null;
  368. public $length = null;
  369. public function __construct($vals=null) {
  370. if (!isset(self::$_TSPEC)) {
  371. self::$_TSPEC = array(
  372. 1 => array(
  373. 'var' => 'hosts',
  374. 'type' => TType::LST,
  375. 'etype' => TType::STRING,
  376. 'elem' => array(
  377. 'type' => TType::STRING,
  378. ),
  379. ),
  380. 2 => array(
  381. 'var' => 'names',
  382. 'type' => TType::LST,
  383. 'etype' => TType::STRING,
  384. 'elem' => array(
  385. 'type' => TType::STRING,
  386. ),
  387. ),
  388. 3 => array(
  389. 'var' => 'offset',
  390. 'type' => TType::I64,
  391. ),
  392. 4 => array(
  393. 'var' => 'length',
  394. 'type' => TType::I64,
  395. ),
  396. );
  397. }
  398. if (is_array($vals)) {
  399. if (isset($vals['hosts'])) {
  400. $this->hosts = $vals['hosts'];
  401. }
  402. if (isset($vals['names'])) {
  403. $this->names = $vals['names'];
  404. }
  405. if (isset($vals['offset'])) {
  406. $this->offset = $vals['offset'];
  407. }
  408. if (isset($vals['length'])) {
  409. $this->length = $vals['length'];
  410. }
  411. }
  412. }
  413. public function getName() {
  414. return 'BlockLocation';
  415. }
  416. public function read($input)
  417. {
  418. $xfer = 0;
  419. $fname = null;
  420. $ftype = 0;
  421. $fid = 0;
  422. $xfer += $input->readStructBegin($fname);
  423. while (true)
  424. {
  425. $xfer += $input->readFieldBegin($fname, $ftype, $fid);
  426. if ($ftype == TType::STOP) {
  427. break;
  428. }
  429. switch ($fid)
  430. {
  431. case 1:
  432. if ($ftype == TType::LST) {
  433. $this->hosts = array();
  434. $_size0 = 0;
  435. $_etype3 = 0;
  436. $xfer += $input->readListBegin($_etype3, $_size0);
  437. for ($_i4 = 0; $_i4 < $_size0; ++$_i4)
  438. {
  439. $elem5 = null;
  440. $xfer += $input->readString($elem5);
  441. $this->hosts []= $elem5;
  442. }
  443. $xfer += $input->readListEnd();
  444. } else {
  445. $xfer += $input->skip($ftype);
  446. }
  447. break;
  448. case 2:
  449. if ($ftype == TType::LST) {
  450. $this->names = array();
  451. $_size6 = 0;
  452. $_etype9 = 0;
  453. $xfer += $input->readListBegin($_etype9, $_size6);
  454. for ($_i10 = 0; $_i10 < $_size6; ++$_i10)
  455. {
  456. $elem11 = null;
  457. $xfer += $input->readString($elem11);
  458. $this->names []= $elem11;
  459. }
  460. $xfer += $input->readListEnd();
  461. } else {
  462. $xfer += $input->skip($ftype);
  463. }
  464. break;
  465. case 3:
  466. if ($ftype == TType::I64) {
  467. $xfer += $input->readI64($this->offset);
  468. } else {
  469. $xfer += $input->skip($ftype);
  470. }
  471. break;
  472. case 4:
  473. if ($ftype == TType::I64) {
  474. $xfer += $input->readI64($this->length);
  475. } else {
  476. $xfer += $input->skip($ftype);
  477. }
  478. break;
  479. default:
  480. $xfer += $input->skip($ftype);
  481. break;
  482. }
  483. $xfer += $input->readFieldEnd();
  484. }
  485. $xfer += $input->readStructEnd();
  486. return $xfer;
  487. }
  488. public function write($output) {
  489. $xfer = 0;
  490. $xfer += $output->writeStructBegin('BlockLocation');
  491. if ($this->hosts !== null) {
  492. if (!is_array($this->hosts)) {
  493. throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
  494. }
  495. $xfer += $output->writeFieldBegin('hosts', TType::LST, 1);
  496. {
  497. $output->writeListBegin(TType::STRING, count($this->hosts));
  498. {
  499. foreach ($this->hosts as $iter12)
  500. {
  501. $xfer += $output->writeString($iter12);
  502. }
  503. }
  504. $output->writeListEnd();
  505. }
  506. $xfer += $output->writeFieldEnd();
  507. }
  508. if ($this->names !== null) {
  509. if (!is_array($this->names)) {
  510. throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
  511. }
  512. $xfer += $output->writeFieldBegin('names', TType::LST, 2);
  513. {
  514. $output->writeListBegin(TType::STRING, count($this->names));
  515. {
  516. foreach ($this->names as $iter13)
  517. {
  518. $xfer += $output->writeString($iter13);
  519. }
  520. }
  521. $output->writeListEnd();
  522. }
  523. $xfer += $output->writeFieldEnd();
  524. }
  525. if ($this->offset !== null) {
  526. $xfer += $output->writeFieldBegin('offset', TType::I64, 3);
  527. $xfer += $output->writeI64($this->offset);
  528. $xfer += $output->writeFieldEnd();
  529. }
  530. if ($this->length !== null) {
  531. $xfer += $output->writeFieldBegin('length', TType::I64, 4);
  532. $xfer += $output->writeI64($this->length);
  533. $xfer += $output->writeFieldEnd();
  534. }
  535. $xfer += $output->writeFieldStop();
  536. $xfer += $output->writeStructEnd();
  537. return $xfer;
  538. }
  539. }
  540. class MalformedInputException extends TException {
  541. static $_TSPEC;
  542. public $message = null;
  543. public function __construct($vals=null) {
  544. if (!isset(self::$_TSPEC)) {
  545. self::$_TSPEC = array(
  546. -1 => array(
  547. 'var' => 'message',
  548. 'type' => TType::STRING,
  549. ),
  550. );
  551. }
  552. if (is_array($vals)) {
  553. if (isset($vals['message'])) {
  554. $this->message = $vals['message'];
  555. }
  556. }
  557. }
  558. public function getName() {
  559. return 'MalformedInputException';
  560. }
  561. public function read($input)
  562. {
  563. $xfer = 0;
  564. $fname = null;
  565. $ftype = 0;
  566. $fid = 0;
  567. $xfer += $input->readStructBegin($fname);
  568. while (true)
  569. {
  570. $xfer += $input->readFieldBegin($fname, $ftype, $fid);
  571. if ($ftype == TType::STOP) {
  572. break;
  573. }
  574. switch ($fid)
  575. {
  576. case -1:
  577. if ($ftype == TType::STRING) {
  578. $xfer += $input->readString($this->message);
  579. } else {
  580. $xfer += $input->skip($ftype);
  581. }
  582. break;
  583. default:
  584. $xfer += $input->skip($ftype);
  585. break;
  586. }
  587. $xfer += $input->readFieldEnd();
  588. }
  589. $xfer += $input->readStructEnd();
  590. return $xfer;
  591. }
  592. public function write($output) {
  593. $xfer = 0;
  594. $xfer += $output->writeStructBegin('MalformedInputException');
  595. if ($this->message !== null) {
  596. $xfer += $output->writeFieldBegin('message', TType::STRING, -1);
  597. $xfer += $output->writeString($this->message);
  598. $xfer += $output->writeFieldEnd();
  599. }
  600. $xfer += $output->writeFieldStop();
  601. $xfer += $output->writeStructEnd();
  602. return $xfer;
  603. }
  604. }
  605. class ThriftIOException extends TException {
  606. static $_TSPEC;
  607. public $message = null;
  608. public function __construct($vals=null) {
  609. if (!isset(self::$_TSPEC)) {
  610. self::$_TSPEC = array(
  611. -1 => array(
  612. 'var' => 'message',
  613. 'type' => TType::STRING,
  614. ),
  615. );
  616. }
  617. if (is_array($vals)) {
  618. if (isset($vals['message'])) {
  619. $this->message = $vals['message'];
  620. }
  621. }
  622. }
  623. public function getName() {
  624. return 'ThriftIOException';
  625. }
  626. public function read($input)
  627. {
  628. $xfer = 0;
  629. $fname = null;
  630. $ftype = 0;
  631. $fid = 0;
  632. $xfer += $input->readStructBegin($fname);
  633. while (true)
  634. {
  635. $xfer += $input->readFieldBegin($fname, $ftype, $fid);
  636. if ($ftype == TType::STOP) {
  637. break;
  638. }
  639. switch ($fid)
  640. {
  641. case -1:
  642. if ($ftype == TType::STRING) {
  643. $xfer += $input->readString($this->message);
  644. } else {
  645. $xfer += $input->skip($ftype);
  646. }
  647. break;
  648. default:
  649. $xfer += $input->skip($ftype);
  650. break;
  651. }
  652. $xfer += $input->readFieldEnd();
  653. }
  654. $xfer += $input->readStructEnd();
  655. return $xfer;
  656. }
  657. public function write($output) {
  658. $xfer = 0;
  659. $xfer += $output->writeStructBegin('ThriftIOException');
  660. if ($this->message !== null) {
  661. $xfer += $output->writeFieldBegin('message', TType::STRING, -1);
  662. $xfer += $output->writeString($this->message);
  663. $xfer += $output->writeFieldEnd();
  664. }
  665. $xfer += $output->writeFieldStop();
  666. $xfer += $output->writeStructEnd();
  667. return $xfer;
  668. }
  669. }
  670. ?>