1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
|
17 | |
|
18 | |
package org.apache.giraph.io.gora.generated; |
19 | |
|
20 | |
|
21 | |
|
22 | |
|
23 | 0 | @SuppressWarnings("all") |
24 | 0 | public class GVertexResult extends |
25 | |
org.apache.gora.persistency.impl.PersistentBase implements |
26 | |
org.apache.avro.specific.SpecificRecord, |
27 | |
org.apache.gora.persistency.Persistent { |
28 | |
|
29 | |
|
30 | |
|
31 | |
|
32 | 0 | public static final org.apache.avro.Schema SCHEMAS = |
33 | 0 | new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\"," + |
34 | |
"\"name\":\"GVertexResult\"," + |
35 | |
"\"namespace\":\"org.apache.giraph.io.gora.generated\"," + |
36 | |
"\"fields\":[{\"name\":\"vertexId\",\"type\":\"string\"}," + |
37 | |
"{\"name\":\"vertexValue\",\"type\":\"float\"}," + |
38 | |
"{\"name\":\"edges\",\"type\":" + |
39 | |
"{\"type\":\"map\",\"values\":\"string\"}}]}"); |
40 | |
|
41 | |
|
42 | 0 | public static enum Field { |
43 | |
|
44 | |
|
45 | |
|
46 | 0 | VERTEX_ID(0, "vertexId"), |
47 | |
|
48 | |
|
49 | |
|
50 | |
|
51 | 0 | VERTEX_VALUE(1, "vertexValue"), |
52 | |
|
53 | |
|
54 | |
|
55 | |
|
56 | 0 | EDGES(2, "edges"); |
57 | |
|
58 | |
|
59 | |
|
60 | |
|
61 | |
private int index; |
62 | |
|
63 | |
|
64 | |
|
65 | |
|
66 | |
private String name; |
67 | |
|
68 | |
|
69 | |
|
70 | |
|
71 | |
|
72 | |
|
73 | 0 | Field(int index, String name) { |
74 | 0 | this.index = index; |
75 | 0 | this.name = name; |
76 | 0 | } |
77 | |
|
78 | |
|
79 | |
|
80 | |
|
81 | |
|
82 | |
public int getIndex() { |
83 | 0 | return index; |
84 | |
} |
85 | |
|
86 | |
|
87 | |
|
88 | |
|
89 | |
|
90 | |
public String getName() { |
91 | 0 | return name; |
92 | |
} |
93 | |
|
94 | |
|
95 | |
|
96 | |
|
97 | |
|
98 | |
public String toString() { |
99 | 0 | return name; |
100 | |
} |
101 | |
}; |
102 | |
|
103 | |
|
104 | |
|
105 | |
|
106 | 0 | private static final String[] ALL_FIELDS = { |
107 | |
"vertexId", "vertexValue", "edges", }; |
108 | |
|
109 | |
|
110 | |
|
111 | |
|
112 | 0 | private static final Tombstone TOMBSTONE = new Tombstone(); |
113 | |
|
114 | |
|
115 | |
|
116 | |
|
117 | |
private java.lang.CharSequence vertexId; |
118 | |
|
119 | |
|
120 | |
|
121 | |
|
122 | |
private float vertexValue; |
123 | |
|
124 | |
|
125 | |
|
126 | |
|
127 | |
private java.util.Map<java.lang.CharSequence, java.lang.CharSequence> edges; |
128 | |
|
129 | |
|
130 | |
|
131 | |
|
132 | |
|
133 | |
public int getFieldsCount() { |
134 | 0 | return GVertexResult.ALL_FIELDS.length; |
135 | |
} |
136 | |
|
137 | |
|
138 | |
|
139 | |
|
140 | |
|
141 | |
public org.apache.avro.Schema getSchema() { |
142 | 0 | return SCHEMAS; |
143 | |
} |
144 | |
|
145 | |
|
146 | |
|
147 | |
|
148 | |
|
149 | |
|
150 | |
public java.lang.Object get(int field) { |
151 | 0 | switch (field) { |
152 | |
case 0: |
153 | 0 | return vertexId; |
154 | |
case 1: |
155 | 0 | return vertexValue; |
156 | |
case 2: |
157 | 0 | return edges; |
158 | |
default: |
159 | 0 | throw new org.apache.avro.AvroRuntimeException("Bad index"); |
160 | |
} |
161 | |
} |
162 | |
|
163 | |
|
164 | |
|
165 | |
|
166 | |
|
167 | |
|
168 | |
@SuppressWarnings(value = "unchecked") |
169 | |
public void put(int field, java.lang.Object value) { |
170 | 0 | switch (field) { |
171 | |
case 0: |
172 | 0 | vertexId = (java.lang.CharSequence) value; |
173 | 0 | break; |
174 | |
case 1: |
175 | 0 | vertexValue = (java.lang.Float) value; |
176 | 0 | break; |
177 | |
case 2: |
178 | 0 | edges = (java.util.Map<java.lang.CharSequence, java.lang.CharSequence>) |
179 | |
((value instanceof org.apache.gora.persistency.Dirtyable) ? value : |
180 | |
new org.apache.gora.persistency.impl.DirtyMapWrapper((java.util.Map) |
181 | |
value)); |
182 | 0 | break; |
183 | |
default: |
184 | 0 | throw new org.apache.avro.AvroRuntimeException("Bad index"); |
185 | |
} |
186 | 0 | } |
187 | |
|
188 | |
|
189 | |
|
190 | |
|
191 | |
|
192 | |
public java.lang.CharSequence getVertexId() { |
193 | 0 | return vertexId; |
194 | |
} |
195 | |
|
196 | |
|
197 | |
|
198 | |
|
199 | |
|
200 | |
public void setVertexId(java.lang.CharSequence value) { |
201 | 0 | this.vertexId = value; |
202 | 0 | setDirty(0); |
203 | 0 | } |
204 | |
|
205 | |
|
206 | |
|
207 | |
|
208 | |
|
209 | |
|
210 | |
|
211 | |
public boolean isVertexIdDirty(java.lang.CharSequence value) { |
212 | 0 | return isDirty(0); |
213 | |
} |
214 | |
|
215 | |
|
216 | |
|
217 | |
|
218 | |
|
219 | |
public java.lang.Float getVertexValue() { |
220 | 0 | return vertexValue; |
221 | |
} |
222 | |
|
223 | |
|
224 | |
|
225 | |
|
226 | |
|
227 | |
public void setVertexValue(java.lang.Float value) { |
228 | 0 | this.vertexValue = value; |
229 | 0 | setDirty(1); |
230 | 0 | } |
231 | |
|
232 | |
|
233 | |
|
234 | |
|
235 | |
|
236 | |
|
237 | |
|
238 | |
public boolean isVertexValueDirty(java.lang.Float value) { |
239 | 0 | return isDirty(1); |
240 | |
} |
241 | |
|
242 | |
|
243 | |
|
244 | |
|
245 | |
|
246 | |
public java.util.Map<java.lang.CharSequence, java.lang.CharSequence> |
247 | |
getEdges() { |
248 | 0 | return edges; |
249 | |
} |
250 | |
|
251 | |
|
252 | |
|
253 | |
|
254 | |
|
255 | |
public void setEdges( |
256 | |
java.util.Map<java.lang.CharSequence, java.lang.CharSequence> value) { |
257 | 0 | this.edges = (value instanceof org.apache.gora.persistency.Dirtyable) ? |
258 | |
value : new org.apache.gora.persistency.impl.DirtyMapWrapper(value); |
259 | 0 | setDirty(2); |
260 | 0 | } |
261 | |
|
262 | |
|
263 | |
|
264 | |
|
265 | |
|
266 | |
|
267 | |
|
268 | |
public boolean isEdgesDirty( |
269 | |
java.util.Map<java.lang.CharSequence, java.lang.CharSequence> value) { |
270 | 0 | return isDirty(2); |
271 | |
} |
272 | |
|
273 | |
|
274 | |
|
275 | |
|
276 | |
|
277 | |
public static org.apache.giraph.io.gora.generated.GVertexResult.Builder |
278 | |
newBuilder() { |
279 | 0 | return new org.apache.giraph.io.gora.generated.GVertexResult.Builder(); |
280 | |
} |
281 | |
|
282 | |
|
283 | |
|
284 | |
|
285 | |
|
286 | |
|
287 | |
public static org.apache.giraph.io.gora.generated.GVertexResult.Builder |
288 | |
newBuilder(org.apache.giraph.io.gora.generated.GVertexResult.Builder other) { |
289 | 0 | return new org.apache.giraph.io.gora.generated.GVertexResult.Builder(other); |
290 | |
} |
291 | |
|
292 | |
|
293 | |
|
294 | |
|
295 | |
|
296 | |
|
297 | |
|
298 | |
public static org.apache.giraph.io.gora.generated.GVertexResult.Builder |
299 | |
newBuilder(org.apache.giraph.io.gora.generated.GVertexResult other) { |
300 | 0 | return new org.apache.giraph.io.gora.generated.GVertexResult.Builder(other); |
301 | |
} |
302 | |
|
303 | |
|
304 | |
|
305 | |
|
306 | |
|
307 | |
|
308 | |
private static java.nio.ByteBuffer deepCopyToReadOnlyBuffer( |
309 | |
java.nio.ByteBuffer input) { |
310 | 0 | java.nio.ByteBuffer copy = java.nio.ByteBuffer.allocate(input.capacity()); |
311 | 0 | int position = input.position(); |
312 | 0 | input.reset(); |
313 | 0 | int mark = input.position(); |
314 | 0 | int limit = input.limit(); |
315 | 0 | input.rewind(); |
316 | 0 | input.limit(input.capacity()); |
317 | 0 | copy.put(input); |
318 | 0 | input.rewind(); |
319 | 0 | copy.rewind(); |
320 | 0 | input.position(mark); |
321 | 0 | input.mark(); |
322 | 0 | copy.position(mark); |
323 | 0 | copy.mark(); |
324 | 0 | input.position(position); |
325 | 0 | copy.position(position); |
326 | 0 | input.limit(limit); |
327 | 0 | copy.limit(limit); |
328 | 0 | return copy.asReadOnlyBuffer(); |
329 | |
} |
330 | |
|
331 | |
|
332 | |
|
333 | |
|
334 | 0 | public static class Builder extends |
335 | |
org.apache.avro.specific.SpecificRecordBuilderBase<GVertexResult> |
336 | |
implements org.apache.avro.data.RecordBuilder<GVertexResult> { |
337 | |
|
338 | |
|
339 | |
|
340 | |
|
341 | |
private java.lang.CharSequence vertexId; |
342 | |
|
343 | |
|
344 | |
|
345 | |
|
346 | |
private float vertexValue; |
347 | |
|
348 | |
|
349 | |
|
350 | |
|
351 | |
private java.util.Map<java.lang.CharSequence, java.lang.CharSequence> edges; |
352 | |
|
353 | |
|
354 | |
private Builder() { |
355 | 0 | super(org.apache.giraph.io.gora.generated.GVertexResult.SCHEMAS); |
356 | 0 | } |
357 | |
|
358 | |
|
359 | |
|
360 | |
|
361 | |
|
362 | |
private Builder( |
363 | |
org.apache.giraph.io.gora.generated.GVertexResult.Builder other) { |
364 | 0 | super(other); |
365 | 0 | } |
366 | |
|
367 | |
|
368 | |
|
369 | |
|
370 | |
|
371 | |
|
372 | |
private Builder(org.apache.giraph.io.gora.generated.GVertexResult other) { |
373 | 0 | super(org.apache.giraph.io.gora.generated.GVertexResult.SCHEMAS); |
374 | 0 | if (isValidValue(fields()[0], other.vertexId)) { |
375 | 0 | this.vertexId = (java.lang.CharSequence) data().deepCopy( |
376 | 0 | fields()[0].schema(), other.vertexId); |
377 | 0 | fieldSetFlags()[0] = true; |
378 | |
} |
379 | 0 | if (isValidValue(fields()[1], other.vertexValue)) { |
380 | 0 | this.vertexValue = (java.lang.Float) data().deepCopy( |
381 | 0 | fields()[1].schema(), other.vertexValue); |
382 | 0 | fieldSetFlags()[1] = true; |
383 | |
} |
384 | 0 | if (isValidValue(fields()[2], other.edges)) { |
385 | 0 | this.edges = |
386 | |
(java.util.Map<java.lang.CharSequence, java.lang.CharSequence>) |
387 | 0 | data().deepCopy(fields()[2].schema(), other.edges); |
388 | 0 | fieldSetFlags()[2] = true; |
389 | |
} |
390 | 0 | } |
391 | |
|
392 | |
|
393 | |
|
394 | |
|
395 | |
|
396 | |
|
397 | |
public java.lang.CharSequence getVertexId() { |
398 | 0 | return vertexId; |
399 | |
} |
400 | |
|
401 | |
|
402 | |
|
403 | |
|
404 | |
|
405 | |
|
406 | |
|
407 | |
public org.apache.giraph.io.gora.generated.GVertexResult.Builder |
408 | |
setVertexId(java.lang.CharSequence value) { |
409 | 0 | validate(fields()[0], value); |
410 | 0 | this.vertexId = value; |
411 | 0 | fieldSetFlags()[0] = true; |
412 | 0 | return this; |
413 | |
} |
414 | |
|
415 | |
|
416 | |
|
417 | |
|
418 | |
|
419 | |
|
420 | |
public boolean hasVertexId() { |
421 | 0 | return fieldSetFlags()[0]; |
422 | |
} |
423 | |
|
424 | |
|
425 | |
|
426 | |
|
427 | |
|
428 | |
|
429 | |
public org.apache.giraph.io.gora.generated.GVertexResult.Builder |
430 | |
clearVertexId() { |
431 | 0 | vertexId = null; |
432 | 0 | fieldSetFlags()[0] = false; |
433 | 0 | return this; |
434 | |
} |
435 | |
|
436 | |
|
437 | |
|
438 | |
|
439 | |
|
440 | |
|
441 | |
public java.lang.Float getVertexValue() { |
442 | 0 | return vertexValue; |
443 | |
} |
444 | |
|
445 | |
|
446 | |
|
447 | |
|
448 | |
|
449 | |
|
450 | |
|
451 | |
public org.apache.giraph.io.gora.generated.GVertexResult.Builder |
452 | |
setVertexValue(float value) { |
453 | 0 | validate(fields()[1], value); |
454 | 0 | this.vertexValue = value; |
455 | 0 | fieldSetFlags()[1] = true; |
456 | 0 | return this; |
457 | |
} |
458 | |
|
459 | |
|
460 | |
|
461 | |
|
462 | |
|
463 | |
|
464 | |
public boolean hasVertexValue() { |
465 | 0 | return fieldSetFlags()[1]; |
466 | |
} |
467 | |
|
468 | |
|
469 | |
|
470 | |
|
471 | |
|
472 | |
|
473 | |
public org.apache.giraph.io.gora.generated.GVertexResult.Builder |
474 | |
clearVertexValue() { |
475 | 0 | fieldSetFlags()[1] = false; |
476 | 0 | return this; |
477 | |
} |
478 | |
|
479 | |
|
480 | |
|
481 | |
|
482 | |
|
483 | |
|
484 | |
public java.util.Map<java.lang.CharSequence, java.lang.CharSequence> |
485 | |
getEdges() { |
486 | 0 | return edges; |
487 | |
} |
488 | |
|
489 | |
|
490 | |
|
491 | |
|
492 | |
|
493 | |
|
494 | |
|
495 | |
public org.apache.giraph.io.gora.generated.GVertexResult.Builder setEdges( |
496 | |
java.util.Map<java.lang.CharSequence, java.lang.CharSequence> value) { |
497 | 0 | validate(fields()[2], value); |
498 | 0 | this.edges = value; |
499 | 0 | fieldSetFlags()[2] = true; |
500 | 0 | return this; |
501 | |
} |
502 | |
|
503 | |
|
504 | |
|
505 | |
|
506 | |
|
507 | |
|
508 | |
public boolean hasEdges() { |
509 | 0 | return fieldSetFlags()[2]; |
510 | |
} |
511 | |
|
512 | |
|
513 | |
|
514 | |
|
515 | |
|
516 | |
|
517 | |
public org.apache.giraph.io.gora.generated.GVertexResult.Builder |
518 | |
clearEdges() { |
519 | 0 | edges = null; |
520 | 0 | fieldSetFlags()[2] = false; |
521 | 0 | return this; |
522 | |
} |
523 | |
|
524 | |
|
525 | |
@Override |
526 | |
|
527 | |
|
528 | |
|
529 | |
|
530 | |
|
531 | |
public GVertexResult build() { |
532 | |
try { |
533 | 0 | GVertexResult record = new GVertexResult(); |
534 | 0 | record.vertexId = fieldSetFlags()[0] ? this.vertexId : |
535 | 0 | (java.lang.CharSequence) defaultValue(fields()[0]); |
536 | 0 | record.vertexValue = fieldSetFlags()[1] ? this.vertexValue : |
537 | 0 | (java.lang.Float) defaultValue(fields()[1]); |
538 | 0 | record.edges = fieldSetFlags()[2] ? this.edges : |
539 | |
(java.util.Map<java.lang.CharSequence, java.lang.CharSequence>) |
540 | |
new org.apache.gora.persistency.impl.DirtyMapWrapper( |
541 | 0 | (java.util.Map) defaultValue(fields()[2])); |
542 | 0 | return record; |
543 | 0 | } catch (Exception e) { |
544 | 0 | throw new org.apache.avro.AvroRuntimeException(e); |
545 | |
} |
546 | |
} |
547 | |
|
548 | |
} |
549 | |
|
550 | |
|
551 | |
|
552 | |
|
553 | |
|
554 | |
public GVertexResult.Tombstone getTombstone() { |
555 | 0 | return TOMBSTONE; |
556 | |
} |
557 | |
|
558 | |
|
559 | |
|
560 | |
|
561 | |
|
562 | |
public GVertexResult newInstance() { |
563 | 0 | return newBuilder().build(); |
564 | |
} |
565 | |
|
566 | |
|
567 | |
|
568 | |
|
569 | 0 | public static final class Tombstone extends GVertexResult implements |
570 | |
org.apache.gora.persistency.Tombstone { |
571 | |
|
572 | |
|
573 | |
|
574 | |
|
575 | 0 | private Tombstone() { |
576 | 0 | } |
577 | |
|
578 | |
|
579 | |
|
580 | |
|
581 | |
|
582 | |
public java.lang.CharSequence getVertexId() { |
583 | 0 | throw new java.lang.UnsupportedOperationException( |
584 | |
"Get is not supported on tombstones"); |
585 | |
} |
586 | |
|
587 | |
|
588 | |
|
589 | |
|
590 | |
|
591 | |
public void setVertexId(java.lang.CharSequence value) { |
592 | 0 | throw new java.lang.UnsupportedOperationException( |
593 | |
"Set is not supported on tombstones"); |
594 | |
} |
595 | |
|
596 | |
|
597 | |
|
598 | |
|
599 | |
|
600 | |
|
601 | |
|
602 | |
public boolean isVertexIdDirty(java.lang.CharSequence value) { |
603 | 0 | throw new java.lang.UnsupportedOperationException( |
604 | |
"IsDirty is not supported on tombstones"); |
605 | |
} |
606 | |
|
607 | |
|
608 | |
|
609 | |
|
610 | |
|
611 | |
public java.lang.Float getVertexValue() { |
612 | 0 | throw new java.lang.UnsupportedOperationException( |
613 | |
"Get is not supported on tombstones"); |
614 | |
} |
615 | |
|
616 | |
|
617 | |
|
618 | |
|
619 | |
|
620 | |
public void setVertexValue(java.lang.Float value) { |
621 | 0 | throw new java.lang.UnsupportedOperationException( |
622 | |
"Set is not supported on tombstones"); |
623 | |
} |
624 | |
|
625 | |
|
626 | |
|
627 | |
|
628 | |
|
629 | |
|
630 | |
|
631 | |
public boolean isVertexValueDirty(java.lang.Float value) { |
632 | 0 | throw new java.lang.UnsupportedOperationException( |
633 | |
"IsDirty is not supported on tombstones"); |
634 | |
} |
635 | |
|
636 | |
|
637 | |
|
638 | |
|
639 | |
|
640 | |
public java.util.Map<java.lang.CharSequence, java.lang.CharSequence> |
641 | |
getEdges() { |
642 | 0 | throw new java.lang.UnsupportedOperationException( |
643 | |
"Get is not supported on tombstones"); |
644 | |
} |
645 | |
|
646 | |
|
647 | |
|
648 | |
|
649 | |
|
650 | |
public void setEdges( |
651 | |
java.util.Map<java.lang.CharSequence, java.lang.CharSequence> value) { |
652 | 0 | throw new java.lang.UnsupportedOperationException( |
653 | |
"Set is not supported on tombstones"); |
654 | |
} |
655 | |
|
656 | |
|
657 | |
|
658 | |
|
659 | |
|
660 | |
|
661 | |
|
662 | |
public boolean isEdgesDirty( |
663 | |
java.util.Map<java.lang.CharSequence, java.lang.CharSequence> value) { |
664 | 0 | throw new java.lang.UnsupportedOperationException( |
665 | |
"IsDirty is not supported on tombstones"); |
666 | |
} |
667 | |
} |
668 | |
} |