1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 /**
18 * Autogenerated by Thrift Compiler (0.9.0)
19 *
20 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
21 * @generated
22 */
23 package org.apache.accumulo.core.data.thrift;
24
25 import org.apache.thrift.scheme.IScheme;
26 import org.apache.thrift.scheme.SchemeFactory;
27 import org.apache.thrift.scheme.StandardScheme;
28
29 import org.apache.thrift.scheme.TupleScheme;
30 import org.apache.thrift.protocol.TTupleProtocol;
31 import org.apache.thrift.protocol.TProtocolException;
32 import org.apache.thrift.EncodingUtils;
33 import org.apache.thrift.TException;
34 import java.util.List;
35 import java.util.ArrayList;
36 import java.util.Map;
37 import java.util.HashMap;
38 import java.util.EnumMap;
39 import java.util.Set;
40 import java.util.HashSet;
41 import java.util.EnumSet;
42 import java.util.Collections;
43 import java.util.BitSet;
44 import java.nio.ByteBuffer;
45 import java.util.Arrays;
46 import org.slf4j.Logger;
47 import org.slf4j.LoggerFactory;
48
49 @SuppressWarnings("all") public class UpdateErrors implements org.apache.thrift.TBase<UpdateErrors, UpdateErrors._Fields>, java.io.Serializable, Cloneable {
50 private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("UpdateErrors");
51
52 private static final org.apache.thrift.protocol.TField FAILED_EXTENTS_FIELD_DESC = new org.apache.thrift.protocol.TField("failedExtents", org.apache.thrift.protocol.TType.MAP, (short)1);
53 private static final org.apache.thrift.protocol.TField VIOLATION_SUMMARIES_FIELD_DESC = new org.apache.thrift.protocol.TField("violationSummaries", org.apache.thrift.protocol.TType.LIST, (short)2);
54 private static final org.apache.thrift.protocol.TField AUTHORIZATION_FAILURES_FIELD_DESC = new org.apache.thrift.protocol.TField("authorizationFailures", org.apache.thrift.protocol.TType.MAP, (short)3);
55
56 private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
57 static {
58 schemes.put(StandardScheme.class, new UpdateErrorsStandardSchemeFactory());
59 schemes.put(TupleScheme.class, new UpdateErrorsTupleSchemeFactory());
60 }
61
62 public Map<TKeyExtent,Long> failedExtents;
63 public List<TConstraintViolationSummary> violationSummaries;
64 public Map<TKeyExtent,org.apache.accumulo.core.security.thrift.SecurityErrorCode> authorizationFailures;
65
66 /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
67 @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
68 FAILED_EXTENTS((short)1, "failedExtents"),
69 VIOLATION_SUMMARIES((short)2, "violationSummaries"),
70 AUTHORIZATION_FAILURES((short)3, "authorizationFailures");
71
72 private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
73
74 static {
75 for (_Fields field : EnumSet.allOf(_Fields.class)) {
76 byName.put(field.getFieldName(), field);
77 }
78 }
79
80 /**
81 * Find the _Fields constant that matches fieldId, or null if its not found.
82 */
83 public static _Fields findByThriftId(int fieldId) {
84 switch(fieldId) {
85 case 1:
86 return FAILED_EXTENTS;
87 case 2:
88 return VIOLATION_SUMMARIES;
89 case 3:
90 return AUTHORIZATION_FAILURES;
91 default:
92 return null;
93 }
94 }
95
96 /**
97 * Find the _Fields constant that matches fieldId, throwing an exception
98 * if it is not found.
99 */
100 public static _Fields findByThriftIdOrThrow(int fieldId) {
101 _Fields fields = findByThriftId(fieldId);
102 if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
103 return fields;
104 }
105
106 /**
107 * Find the _Fields constant that matches name, or null if its not found.
108 */
109 public static _Fields findByName(String name) {
110 return byName.get(name);
111 }
112
113 private final short _thriftId;
114 private final String _fieldName;
115
116 _Fields(short thriftId, String fieldName) {
117 _thriftId = thriftId;
118 _fieldName = fieldName;
119 }
120
121 public short getThriftFieldId() {
122 return _thriftId;
123 }
124
125 public String getFieldName() {
126 return _fieldName;
127 }
128 }
129
130
131 public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
132 static {
133 Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
134 tmpMap.put(_Fields.FAILED_EXTENTS, new org.apache.thrift.meta_data.FieldMetaData("failedExtents", org.apache.thrift.TFieldRequirementType.DEFAULT,
135 new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP,
136 new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TKeyExtent.class),
137 new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))));
138 tmpMap.put(_Fields.VIOLATION_SUMMARIES, new org.apache.thrift.meta_data.FieldMetaData("violationSummaries", org.apache.thrift.TFieldRequirementType.DEFAULT,
139 new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,
140 new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TConstraintViolationSummary.class))));
141 tmpMap.put(_Fields.AUTHORIZATION_FAILURES, new org.apache.thrift.meta_data.FieldMetaData("authorizationFailures", org.apache.thrift.TFieldRequirementType.DEFAULT,
142 new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP,
143 new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TKeyExtent.class),
144 new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, org.apache.accumulo.core.security.thrift.SecurityErrorCode.class))));
145 metaDataMap = Collections.unmodifiableMap(tmpMap);
146 org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(UpdateErrors.class, metaDataMap);
147 }
148
149 public UpdateErrors() {
150 }
151
152 public UpdateErrors(
153 Map<TKeyExtent,Long> failedExtents,
154 List<TConstraintViolationSummary> violationSummaries,
155 Map<TKeyExtent,org.apache.accumulo.core.security.thrift.SecurityErrorCode> authorizationFailures)
156 {
157 this();
158 this.failedExtents = failedExtents;
159 this.violationSummaries = violationSummaries;
160 this.authorizationFailures = authorizationFailures;
161 }
162
163 /**
164 * Performs a deep copy on <i>other</i>.
165 */
166 public UpdateErrors(UpdateErrors other) {
167 if (other.isSetFailedExtents()) {
168 Map<TKeyExtent,Long> __this__failedExtents = new HashMap<TKeyExtent,Long>();
169 for (Map.Entry<TKeyExtent, Long> other_element : other.failedExtents.entrySet()) {
170
171 TKeyExtent other_element_key = other_element.getKey();
172 Long other_element_value = other_element.getValue();
173
174 TKeyExtent __this__failedExtents_copy_key = new TKeyExtent(other_element_key);
175
176 Long __this__failedExtents_copy_value = other_element_value;
177
178 __this__failedExtents.put(__this__failedExtents_copy_key, __this__failedExtents_copy_value);
179 }
180 this.failedExtents = __this__failedExtents;
181 }
182 if (other.isSetViolationSummaries()) {
183 List<TConstraintViolationSummary> __this__violationSummaries = new ArrayList<TConstraintViolationSummary>();
184 for (TConstraintViolationSummary other_element : other.violationSummaries) {
185 __this__violationSummaries.add(new TConstraintViolationSummary(other_element));
186 }
187 this.violationSummaries = __this__violationSummaries;
188 }
189 if (other.isSetAuthorizationFailures()) {
190 Map<TKeyExtent,org.apache.accumulo.core.security.thrift.SecurityErrorCode> __this__authorizationFailures = new HashMap<TKeyExtent,org.apache.accumulo.core.security.thrift.SecurityErrorCode>();
191 for (Map.Entry<TKeyExtent, org.apache.accumulo.core.security.thrift.SecurityErrorCode> other_element : other.authorizationFailures.entrySet()) {
192
193 TKeyExtent other_element_key = other_element.getKey();
194 org.apache.accumulo.core.security.thrift.SecurityErrorCode other_element_value = other_element.getValue();
195
196 TKeyExtent __this__authorizationFailures_copy_key = new TKeyExtent(other_element_key);
197
198 org.apache.accumulo.core.security.thrift.SecurityErrorCode __this__authorizationFailures_copy_value = other_element_value;
199
200 __this__authorizationFailures.put(__this__authorizationFailures_copy_key, __this__authorizationFailures_copy_value);
201 }
202 this.authorizationFailures = __this__authorizationFailures;
203 }
204 }
205
206 public UpdateErrors deepCopy() {
207 return new UpdateErrors(this);
208 }
209
210 @Override
211 public void clear() {
212 this.failedExtents = null;
213 this.violationSummaries = null;
214 this.authorizationFailures = null;
215 }
216
217 public int getFailedExtentsSize() {
218 return (this.failedExtents == null) ? 0 : this.failedExtents.size();
219 }
220
221 public void putToFailedExtents(TKeyExtent key, long val) {
222 if (this.failedExtents == null) {
223 this.failedExtents = new HashMap<TKeyExtent,Long>();
224 }
225 this.failedExtents.put(key, val);
226 }
227
228 public Map<TKeyExtent,Long> getFailedExtents() {
229 return this.failedExtents;
230 }
231
232 public UpdateErrors setFailedExtents(Map<TKeyExtent,Long> failedExtents) {
233 this.failedExtents = failedExtents;
234 return this;
235 }
236
237 public void unsetFailedExtents() {
238 this.failedExtents = null;
239 }
240
241 /** Returns true if field failedExtents is set (has been assigned a value) and false otherwise */
242 public boolean isSetFailedExtents() {
243 return this.failedExtents != null;
244 }
245
246 public void setFailedExtentsIsSet(boolean value) {
247 if (!value) {
248 this.failedExtents = null;
249 }
250 }
251
252 public int getViolationSummariesSize() {
253 return (this.violationSummaries == null) ? 0 : this.violationSummaries.size();
254 }
255
256 public java.util.Iterator<TConstraintViolationSummary> getViolationSummariesIterator() {
257 return (this.violationSummaries == null) ? null : this.violationSummaries.iterator();
258 }
259
260 public void addToViolationSummaries(TConstraintViolationSummary elem) {
261 if (this.violationSummaries == null) {
262 this.violationSummaries = new ArrayList<TConstraintViolationSummary>();
263 }
264 this.violationSummaries.add(elem);
265 }
266
267 public List<TConstraintViolationSummary> getViolationSummaries() {
268 return this.violationSummaries;
269 }
270
271 public UpdateErrors setViolationSummaries(List<TConstraintViolationSummary> violationSummaries) {
272 this.violationSummaries = violationSummaries;
273 return this;
274 }
275
276 public void unsetViolationSummaries() {
277 this.violationSummaries = null;
278 }
279
280 /** Returns true if field violationSummaries is set (has been assigned a value) and false otherwise */
281 public boolean isSetViolationSummaries() {
282 return this.violationSummaries != null;
283 }
284
285 public void setViolationSummariesIsSet(boolean value) {
286 if (!value) {
287 this.violationSummaries = null;
288 }
289 }
290
291 public int getAuthorizationFailuresSize() {
292 return (this.authorizationFailures == null) ? 0 : this.authorizationFailures.size();
293 }
294
295 public void putToAuthorizationFailures(TKeyExtent key, org.apache.accumulo.core.security.thrift.SecurityErrorCode val) {
296 if (this.authorizationFailures == null) {
297 this.authorizationFailures = new HashMap<TKeyExtent,org.apache.accumulo.core.security.thrift.SecurityErrorCode>();
298 }
299 this.authorizationFailures.put(key, val);
300 }
301
302 public Map<TKeyExtent,org.apache.accumulo.core.security.thrift.SecurityErrorCode> getAuthorizationFailures() {
303 return this.authorizationFailures;
304 }
305
306 public UpdateErrors setAuthorizationFailures(Map<TKeyExtent,org.apache.accumulo.core.security.thrift.SecurityErrorCode> authorizationFailures) {
307 this.authorizationFailures = authorizationFailures;
308 return this;
309 }
310
311 public void unsetAuthorizationFailures() {
312 this.authorizationFailures = null;
313 }
314
315 /** Returns true if field authorizationFailures is set (has been assigned a value) and false otherwise */
316 public boolean isSetAuthorizationFailures() {
317 return this.authorizationFailures != null;
318 }
319
320 public void setAuthorizationFailuresIsSet(boolean value) {
321 if (!value) {
322 this.authorizationFailures = null;
323 }
324 }
325
326 public void setFieldValue(_Fields field, Object value) {
327 switch (field) {
328 case FAILED_EXTENTS:
329 if (value == null) {
330 unsetFailedExtents();
331 } else {
332 setFailedExtents((Map<TKeyExtent,Long>)value);
333 }
334 break;
335
336 case VIOLATION_SUMMARIES:
337 if (value == null) {
338 unsetViolationSummaries();
339 } else {
340 setViolationSummaries((List<TConstraintViolationSummary>)value);
341 }
342 break;
343
344 case AUTHORIZATION_FAILURES:
345 if (value == null) {
346 unsetAuthorizationFailures();
347 } else {
348 setAuthorizationFailures((Map<TKeyExtent,org.apache.accumulo.core.security.thrift.SecurityErrorCode>)value);
349 }
350 break;
351
352 }
353 }
354
355 public Object getFieldValue(_Fields field) {
356 switch (field) {
357 case FAILED_EXTENTS:
358 return getFailedExtents();
359
360 case VIOLATION_SUMMARIES:
361 return getViolationSummaries();
362
363 case AUTHORIZATION_FAILURES:
364 return getAuthorizationFailures();
365
366 }
367 throw new IllegalStateException();
368 }
369
370 /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
371 public boolean isSet(_Fields field) {
372 if (field == null) {
373 throw new IllegalArgumentException();
374 }
375
376 switch (field) {
377 case FAILED_EXTENTS:
378 return isSetFailedExtents();
379 case VIOLATION_SUMMARIES:
380 return isSetViolationSummaries();
381 case AUTHORIZATION_FAILURES:
382 return isSetAuthorizationFailures();
383 }
384 throw new IllegalStateException();
385 }
386
387 @Override
388 public boolean equals(Object that) {
389 if (that == null)
390 return false;
391 if (that instanceof UpdateErrors)
392 return this.equals((UpdateErrors)that);
393 return false;
394 }
395
396 public boolean equals(UpdateErrors that) {
397 if (that == null)
398 return false;
399
400 boolean this_present_failedExtents = true && this.isSetFailedExtents();
401 boolean that_present_failedExtents = true && that.isSetFailedExtents();
402 if (this_present_failedExtents || that_present_failedExtents) {
403 if (!(this_present_failedExtents && that_present_failedExtents))
404 return false;
405 if (!this.failedExtents.equals(that.failedExtents))
406 return false;
407 }
408
409 boolean this_present_violationSummaries = true && this.isSetViolationSummaries();
410 boolean that_present_violationSummaries = true && that.isSetViolationSummaries();
411 if (this_present_violationSummaries || that_present_violationSummaries) {
412 if (!(this_present_violationSummaries && that_present_violationSummaries))
413 return false;
414 if (!this.violationSummaries.equals(that.violationSummaries))
415 return false;
416 }
417
418 boolean this_present_authorizationFailures = true && this.isSetAuthorizationFailures();
419 boolean that_present_authorizationFailures = true && that.isSetAuthorizationFailures();
420 if (this_present_authorizationFailures || that_present_authorizationFailures) {
421 if (!(this_present_authorizationFailures && that_present_authorizationFailures))
422 return false;
423 if (!this.authorizationFailures.equals(that.authorizationFailures))
424 return false;
425 }
426
427 return true;
428 }
429
430 @Override
431 public int hashCode() {
432 return 0;
433 }
434
435 public int compareTo(UpdateErrors other) {
436 if (!getClass().equals(other.getClass())) {
437 return getClass().getName().compareTo(other.getClass().getName());
438 }
439
440 int lastComparison = 0;
441 UpdateErrors typedOther = (UpdateErrors)other;
442
443 lastComparison = Boolean.valueOf(isSetFailedExtents()).compareTo(typedOther.isSetFailedExtents());
444 if (lastComparison != 0) {
445 return lastComparison;
446 }
447 if (isSetFailedExtents()) {
448 lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.failedExtents, typedOther.failedExtents);
449 if (lastComparison != 0) {
450 return lastComparison;
451 }
452 }
453 lastComparison = Boolean.valueOf(isSetViolationSummaries()).compareTo(typedOther.isSetViolationSummaries());
454 if (lastComparison != 0) {
455 return lastComparison;
456 }
457 if (isSetViolationSummaries()) {
458 lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.violationSummaries, typedOther.violationSummaries);
459 if (lastComparison != 0) {
460 return lastComparison;
461 }
462 }
463 lastComparison = Boolean.valueOf(isSetAuthorizationFailures()).compareTo(typedOther.isSetAuthorizationFailures());
464 if (lastComparison != 0) {
465 return lastComparison;
466 }
467 if (isSetAuthorizationFailures()) {
468 lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.authorizationFailures, typedOther.authorizationFailures);
469 if (lastComparison != 0) {
470 return lastComparison;
471 }
472 }
473 return 0;
474 }
475
476 public _Fields fieldForId(int fieldId) {
477 return _Fields.findByThriftId(fieldId);
478 }
479
480 public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
481 schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
482 }
483
484 public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
485 schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
486 }
487
488 @Override
489 public String toString() {
490 StringBuilder sb = new StringBuilder("UpdateErrors(");
491 boolean first = true;
492
493 sb.append("failedExtents:");
494 if (this.failedExtents == null) {
495 sb.append("null");
496 } else {
497 sb.append(this.failedExtents);
498 }
499 first = false;
500 if (!first) sb.append(", ");
501 sb.append("violationSummaries:");
502 if (this.violationSummaries == null) {
503 sb.append("null");
504 } else {
505 sb.append(this.violationSummaries);
506 }
507 first = false;
508 if (!first) sb.append(", ");
509 sb.append("authorizationFailures:");
510 if (this.authorizationFailures == null) {
511 sb.append("null");
512 } else {
513 sb.append(this.authorizationFailures);
514 }
515 first = false;
516 sb.append(")");
517 return sb.toString();
518 }
519
520 public void validate() throws org.apache.thrift.TException {
521
522
523 }
524
525 private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
526 try {
527 write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
528 } catch (org.apache.thrift.TException te) {
529 throw new java.io.IOException(te);
530 }
531 }
532
533 private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
534 try {
535 read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
536 } catch (org.apache.thrift.TException te) {
537 throw new java.io.IOException(te);
538 }
539 }
540
541 private static class UpdateErrorsStandardSchemeFactory implements SchemeFactory {
542 public UpdateErrorsStandardScheme getScheme() {
543 return new UpdateErrorsStandardScheme();
544 }
545 }
546
547 private static class UpdateErrorsStandardScheme extends StandardScheme<UpdateErrors> {
548
549 public void read(org.apache.thrift.protocol.TProtocol iprot, UpdateErrors struct) throws org.apache.thrift.TException {
550 org.apache.thrift.protocol.TField schemeField;
551 iprot.readStructBegin();
552 while (true)
553 {
554 schemeField = iprot.readFieldBegin();
555 if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
556 break;
557 }
558 switch (schemeField.id) {
559 case 1:
560 if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
561 {
562 org.apache.thrift.protocol.TMap _map50 = iprot.readMapBegin();
563 struct.failedExtents = new HashMap<TKeyExtent,Long>(2*_map50.size);
564 for (int _i51 = 0; _i51 < _map50.size; ++_i51)
565 {
566 TKeyExtent _key52;
567 long _val53;
568 _key52 = new TKeyExtent();
569 _key52.read(iprot);
570 _val53 = iprot.readI64();
571 struct.failedExtents.put(_key52, _val53);
572 }
573 iprot.readMapEnd();
574 }
575 struct.setFailedExtentsIsSet(true);
576 } else {
577 org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
578 }
579 break;
580 case 2:
581 if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
582 {
583 org.apache.thrift.protocol.TList _list54 = iprot.readListBegin();
584 struct.violationSummaries = new ArrayList<TConstraintViolationSummary>(_list54.size);
585 for (int _i55 = 0; _i55 < _list54.size; ++_i55)
586 {
587 TConstraintViolationSummary _elem56;
588 _elem56 = new TConstraintViolationSummary();
589 _elem56.read(iprot);
590 struct.violationSummaries.add(_elem56);
591 }
592 iprot.readListEnd();
593 }
594 struct.setViolationSummariesIsSet(true);
595 } else {
596 org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
597 }
598 break;
599 case 3:
600 if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
601 {
602 org.apache.thrift.protocol.TMap _map57 = iprot.readMapBegin();
603 struct.authorizationFailures = new HashMap<TKeyExtent,org.apache.accumulo.core.security.thrift.SecurityErrorCode>(2*_map57.size);
604 for (int _i58 = 0; _i58 < _map57.size; ++_i58)
605 {
606 TKeyExtent _key59;
607 org.apache.accumulo.core.security.thrift.SecurityErrorCode _val60;
608 _key59 = new TKeyExtent();
609 _key59.read(iprot);
610 _val60 = org.apache.accumulo.core.security.thrift.SecurityErrorCode.findByValue(iprot.readI32());
611 struct.authorizationFailures.put(_key59, _val60);
612 }
613 iprot.readMapEnd();
614 }
615 struct.setAuthorizationFailuresIsSet(true);
616 } else {
617 org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
618 }
619 break;
620 default:
621 org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
622 }
623 iprot.readFieldEnd();
624 }
625 iprot.readStructEnd();
626
627
628 struct.validate();
629 }
630
631 public void write(org.apache.thrift.protocol.TProtocol oprot, UpdateErrors struct) throws org.apache.thrift.TException {
632 struct.validate();
633
634 oprot.writeStructBegin(STRUCT_DESC);
635 if (struct.failedExtents != null) {
636 oprot.writeFieldBegin(FAILED_EXTENTS_FIELD_DESC);
637 {
638 oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRUCT, org.apache.thrift.protocol.TType.I64, struct.failedExtents.size()));
639 for (Map.Entry<TKeyExtent, Long> _iter61 : struct.failedExtents.entrySet())
640 {
641 _iter61.getKey().write(oprot);
642 oprot.writeI64(_iter61.getValue());
643 }
644 oprot.writeMapEnd();
645 }
646 oprot.writeFieldEnd();
647 }
648 if (struct.violationSummaries != null) {
649 oprot.writeFieldBegin(VIOLATION_SUMMARIES_FIELD_DESC);
650 {
651 oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.violationSummaries.size()));
652 for (TConstraintViolationSummary _iter62 : struct.violationSummaries)
653 {
654 _iter62.write(oprot);
655 }
656 oprot.writeListEnd();
657 }
658 oprot.writeFieldEnd();
659 }
660 if (struct.authorizationFailures != null) {
661 oprot.writeFieldBegin(AUTHORIZATION_FAILURES_FIELD_DESC);
662 {
663 oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRUCT, org.apache.thrift.protocol.TType.I32, struct.authorizationFailures.size()));
664 for (Map.Entry<TKeyExtent, org.apache.accumulo.core.security.thrift.SecurityErrorCode> _iter63 : struct.authorizationFailures.entrySet())
665 {
666 _iter63.getKey().write(oprot);
667 oprot.writeI32(_iter63.getValue().getValue());
668 }
669 oprot.writeMapEnd();
670 }
671 oprot.writeFieldEnd();
672 }
673 oprot.writeFieldStop();
674 oprot.writeStructEnd();
675 }
676
677 }
678
679 private static class UpdateErrorsTupleSchemeFactory implements SchemeFactory {
680 public UpdateErrorsTupleScheme getScheme() {
681 return new UpdateErrorsTupleScheme();
682 }
683 }
684
685 private static class UpdateErrorsTupleScheme extends TupleScheme<UpdateErrors> {
686
687 @Override
688 public void write(org.apache.thrift.protocol.TProtocol prot, UpdateErrors struct) throws org.apache.thrift.TException {
689 TTupleProtocol oprot = (TTupleProtocol) prot;
690 BitSet optionals = new BitSet();
691 if (struct.isSetFailedExtents()) {
692 optionals.set(0);
693 }
694 if (struct.isSetViolationSummaries()) {
695 optionals.set(1);
696 }
697 if (struct.isSetAuthorizationFailures()) {
698 optionals.set(2);
699 }
700 oprot.writeBitSet(optionals, 3);
701 if (struct.isSetFailedExtents()) {
702 {
703 oprot.writeI32(struct.failedExtents.size());
704 for (Map.Entry<TKeyExtent, Long> _iter64 : struct.failedExtents.entrySet())
705 {
706 _iter64.getKey().write(oprot);
707 oprot.writeI64(_iter64.getValue());
708 }
709 }
710 }
711 if (struct.isSetViolationSummaries()) {
712 {
713 oprot.writeI32(struct.violationSummaries.size());
714 for (TConstraintViolationSummary _iter65 : struct.violationSummaries)
715 {
716 _iter65.write(oprot);
717 }
718 }
719 }
720 if (struct.isSetAuthorizationFailures()) {
721 {
722 oprot.writeI32(struct.authorizationFailures.size());
723 for (Map.Entry<TKeyExtent, org.apache.accumulo.core.security.thrift.SecurityErrorCode> _iter66 : struct.authorizationFailures.entrySet())
724 {
725 _iter66.getKey().write(oprot);
726 oprot.writeI32(_iter66.getValue().getValue());
727 }
728 }
729 }
730 }
731
732 @Override
733 public void read(org.apache.thrift.protocol.TProtocol prot, UpdateErrors struct) throws org.apache.thrift.TException {
734 TTupleProtocol iprot = (TTupleProtocol) prot;
735 BitSet incoming = iprot.readBitSet(3);
736 if (incoming.get(0)) {
737 {
738 org.apache.thrift.protocol.TMap _map67 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRUCT, org.apache.thrift.protocol.TType.I64, iprot.readI32());
739 struct.failedExtents = new HashMap<TKeyExtent,Long>(2*_map67.size);
740 for (int _i68 = 0; _i68 < _map67.size; ++_i68)
741 {
742 TKeyExtent _key69;
743 long _val70;
744 _key69 = new TKeyExtent();
745 _key69.read(iprot);
746 _val70 = iprot.readI64();
747 struct.failedExtents.put(_key69, _val70);
748 }
749 }
750 struct.setFailedExtentsIsSet(true);
751 }
752 if (incoming.get(1)) {
753 {
754 org.apache.thrift.protocol.TList _list71 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
755 struct.violationSummaries = new ArrayList<TConstraintViolationSummary>(_list71.size);
756 for (int _i72 = 0; _i72 < _list71.size; ++_i72)
757 {
758 TConstraintViolationSummary _elem73;
759 _elem73 = new TConstraintViolationSummary();
760 _elem73.read(iprot);
761 struct.violationSummaries.add(_elem73);
762 }
763 }
764 struct.setViolationSummariesIsSet(true);
765 }
766 if (incoming.get(2)) {
767 {
768 org.apache.thrift.protocol.TMap _map74 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRUCT, org.apache.thrift.protocol.TType.I32, iprot.readI32());
769 struct.authorizationFailures = new HashMap<TKeyExtent,org.apache.accumulo.core.security.thrift.SecurityErrorCode>(2*_map74.size);
770 for (int _i75 = 0; _i75 < _map74.size; ++_i75)
771 {
772 TKeyExtent _key76;
773 org.apache.accumulo.core.security.thrift.SecurityErrorCode _val77;
774 _key76 = new TKeyExtent();
775 _key76.read(iprot);
776 _val77 = org.apache.accumulo.core.security.thrift.SecurityErrorCode.findByValue(iprot.readI32());
777 struct.authorizationFailures.put(_key76, _val77);
778 }
779 }
780 struct.setAuthorizationFailuresIsSet(true);
781 }
782 }
783 }
784
785 }
786