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