source: proiecte/HadoopJUnit/hadoop-0.20.1/src/contrib/thriftfs/gen-php/hadoopfs_types.php @ 176

Last change on this file since 176 was 120, checked in by (none), 14 years ago

Added the mail files for the Hadoop JUNit Project

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