View Javadoc

1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one or more
3    * contributor license agreements.  See the NOTICE file distributed with
4    * this work for additional information regarding copyright ownership.
5    * The ASF licenses this file to You under the Apache License, Version 2.0
6    * (the "License"); you may not use this file except in compliance with
7    * the License.  You may obtain a copy of the License at
8    *
9    *     http://www.apache.org/licenses/LICENSE-2.0
10   *
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS,
13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   * See the License for the specific language governing permissions and
15   * limitations under the License.
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.gc.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 GcCycleStats implements org.apache.thrift.TBase<GcCycleStats, GcCycleStats._Fields>, java.io.Serializable, Cloneable {
50    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GcCycleStats");
51  
52    private static final org.apache.thrift.protocol.TField STARTED_FIELD_DESC = new org.apache.thrift.protocol.TField("started", org.apache.thrift.protocol.TType.I64, (short)1);
53    private static final org.apache.thrift.protocol.TField FINISHED_FIELD_DESC = new org.apache.thrift.protocol.TField("finished", org.apache.thrift.protocol.TType.I64, (short)2);
54    private static final org.apache.thrift.protocol.TField CANDIDATES_FIELD_DESC = new org.apache.thrift.protocol.TField("candidates", org.apache.thrift.protocol.TType.I64, (short)3);
55    private static final org.apache.thrift.protocol.TField IN_USE_FIELD_DESC = new org.apache.thrift.protocol.TField("inUse", org.apache.thrift.protocol.TType.I64, (short)4);
56    private static final org.apache.thrift.protocol.TField DELETED_FIELD_DESC = new org.apache.thrift.protocol.TField("deleted", org.apache.thrift.protocol.TType.I64, (short)5);
57    private static final org.apache.thrift.protocol.TField ERRORS_FIELD_DESC = new org.apache.thrift.protocol.TField("errors", org.apache.thrift.protocol.TType.I64, (short)6);
58  
59    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
60    static {
61      schemes.put(StandardScheme.class, new GcCycleStatsStandardSchemeFactory());
62      schemes.put(TupleScheme.class, new GcCycleStatsTupleSchemeFactory());
63    }
64  
65    public long started; // required
66    public long finished; // required
67    public long candidates; // required
68    public long inUse; // required
69    public long deleted; // required
70    public long errors; // required
71  
72    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
73    @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
74      STARTED((short)1, "started"),
75      FINISHED((short)2, "finished"),
76      CANDIDATES((short)3, "candidates"),
77      IN_USE((short)4, "inUse"),
78      DELETED((short)5, "deleted"),
79      ERRORS((short)6, "errors");
80  
81      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
82  
83      static {
84        for (_Fields field : EnumSet.allOf(_Fields.class)) {
85          byName.put(field.getFieldName(), field);
86        }
87      }
88  
89      /**
90       * Find the _Fields constant that matches fieldId, or null if its not found.
91       */
92      public static _Fields findByThriftId(int fieldId) {
93        switch(fieldId) {
94          case 1: // STARTED
95            return STARTED;
96          case 2: // FINISHED
97            return FINISHED;
98          case 3: // CANDIDATES
99            return CANDIDATES;
100         case 4: // IN_USE
101           return IN_USE;
102         case 5: // DELETED
103           return DELETED;
104         case 6: // ERRORS
105           return ERRORS;
106         default:
107           return null;
108       }
109     }
110 
111     /**
112      * Find the _Fields constant that matches fieldId, throwing an exception
113      * if it is not found.
114      */
115     public static _Fields findByThriftIdOrThrow(int fieldId) {
116       _Fields fields = findByThriftId(fieldId);
117       if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
118       return fields;
119     }
120 
121     /**
122      * Find the _Fields constant that matches name, or null if its not found.
123      */
124     public static _Fields findByName(String name) {
125       return byName.get(name);
126     }
127 
128     private final short _thriftId;
129     private final String _fieldName;
130 
131     _Fields(short thriftId, String fieldName) {
132       _thriftId = thriftId;
133       _fieldName = fieldName;
134     }
135 
136     public short getThriftFieldId() {
137       return _thriftId;
138     }
139 
140     public String getFieldName() {
141       return _fieldName;
142     }
143   }
144 
145   // isset id assignments
146   private static final int __STARTED_ISSET_ID = 0;
147   private static final int __FINISHED_ISSET_ID = 1;
148   private static final int __CANDIDATES_ISSET_ID = 2;
149   private static final int __INUSE_ISSET_ID = 3;
150   private static final int __DELETED_ISSET_ID = 4;
151   private static final int __ERRORS_ISSET_ID = 5;
152   private byte __isset_bitfield = 0;
153   public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
154   static {
155     Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
156     tmpMap.put(_Fields.STARTED, new org.apache.thrift.meta_data.FieldMetaData("started", org.apache.thrift.TFieldRequirementType.DEFAULT, 
157         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
158     tmpMap.put(_Fields.FINISHED, new org.apache.thrift.meta_data.FieldMetaData("finished", org.apache.thrift.TFieldRequirementType.DEFAULT, 
159         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
160     tmpMap.put(_Fields.CANDIDATES, new org.apache.thrift.meta_data.FieldMetaData("candidates", org.apache.thrift.TFieldRequirementType.DEFAULT, 
161         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
162     tmpMap.put(_Fields.IN_USE, new org.apache.thrift.meta_data.FieldMetaData("inUse", org.apache.thrift.TFieldRequirementType.DEFAULT, 
163         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
164     tmpMap.put(_Fields.DELETED, new org.apache.thrift.meta_data.FieldMetaData("deleted", org.apache.thrift.TFieldRequirementType.DEFAULT, 
165         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
166     tmpMap.put(_Fields.ERRORS, new org.apache.thrift.meta_data.FieldMetaData("errors", org.apache.thrift.TFieldRequirementType.DEFAULT, 
167         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
168     metaDataMap = Collections.unmodifiableMap(tmpMap);
169     org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GcCycleStats.class, metaDataMap);
170   }
171 
172   public GcCycleStats() {
173   }
174 
175   public GcCycleStats(
176     long started,
177     long finished,
178     long candidates,
179     long inUse,
180     long deleted,
181     long errors)
182   {
183     this();
184     this.started = started;
185     setStartedIsSet(true);
186     this.finished = finished;
187     setFinishedIsSet(true);
188     this.candidates = candidates;
189     setCandidatesIsSet(true);
190     this.inUse = inUse;
191     setInUseIsSet(true);
192     this.deleted = deleted;
193     setDeletedIsSet(true);
194     this.errors = errors;
195     setErrorsIsSet(true);
196   }
197 
198   /**
199    * Performs a deep copy on <i>other</i>.
200    */
201   public GcCycleStats(GcCycleStats other) {
202     __isset_bitfield = other.__isset_bitfield;
203     this.started = other.started;
204     this.finished = other.finished;
205     this.candidates = other.candidates;
206     this.inUse = other.inUse;
207     this.deleted = other.deleted;
208     this.errors = other.errors;
209   }
210 
211   public GcCycleStats deepCopy() {
212     return new GcCycleStats(this);
213   }
214 
215   @Override
216   public void clear() {
217     setStartedIsSet(false);
218     this.started = 0;
219     setFinishedIsSet(false);
220     this.finished = 0;
221     setCandidatesIsSet(false);
222     this.candidates = 0;
223     setInUseIsSet(false);
224     this.inUse = 0;
225     setDeletedIsSet(false);
226     this.deleted = 0;
227     setErrorsIsSet(false);
228     this.errors = 0;
229   }
230 
231   public long getStarted() {
232     return this.started;
233   }
234 
235   public GcCycleStats setStarted(long started) {
236     this.started = started;
237     setStartedIsSet(true);
238     return this;
239   }
240 
241   public void unsetStarted() {
242     __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __STARTED_ISSET_ID);
243   }
244 
245   /** Returns true if field started is set (has been assigned a value) and false otherwise */
246   public boolean isSetStarted() {
247     return EncodingUtils.testBit(__isset_bitfield, __STARTED_ISSET_ID);
248   }
249 
250   public void setStartedIsSet(boolean value) {
251     __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __STARTED_ISSET_ID, value);
252   }
253 
254   public long getFinished() {
255     return this.finished;
256   }
257 
258   public GcCycleStats setFinished(long finished) {
259     this.finished = finished;
260     setFinishedIsSet(true);
261     return this;
262   }
263 
264   public void unsetFinished() {
265     __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __FINISHED_ISSET_ID);
266   }
267 
268   /** Returns true if field finished is set (has been assigned a value) and false otherwise */
269   public boolean isSetFinished() {
270     return EncodingUtils.testBit(__isset_bitfield, __FINISHED_ISSET_ID);
271   }
272 
273   public void setFinishedIsSet(boolean value) {
274     __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __FINISHED_ISSET_ID, value);
275   }
276 
277   public long getCandidates() {
278     return this.candidates;
279   }
280 
281   public GcCycleStats setCandidates(long candidates) {
282     this.candidates = candidates;
283     setCandidatesIsSet(true);
284     return this;
285   }
286 
287   public void unsetCandidates() {
288     __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __CANDIDATES_ISSET_ID);
289   }
290 
291   /** Returns true if field candidates is set (has been assigned a value) and false otherwise */
292   public boolean isSetCandidates() {
293     return EncodingUtils.testBit(__isset_bitfield, __CANDIDATES_ISSET_ID);
294   }
295 
296   public void setCandidatesIsSet(boolean value) {
297     __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __CANDIDATES_ISSET_ID, value);
298   }
299 
300   public long getInUse() {
301     return this.inUse;
302   }
303 
304   public GcCycleStats setInUse(long inUse) {
305     this.inUse = inUse;
306     setInUseIsSet(true);
307     return this;
308   }
309 
310   public void unsetInUse() {
311     __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __INUSE_ISSET_ID);
312   }
313 
314   /** Returns true if field inUse is set (has been assigned a value) and false otherwise */
315   public boolean isSetInUse() {
316     return EncodingUtils.testBit(__isset_bitfield, __INUSE_ISSET_ID);
317   }
318 
319   public void setInUseIsSet(boolean value) {
320     __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __INUSE_ISSET_ID, value);
321   }
322 
323   public long getDeleted() {
324     return this.deleted;
325   }
326 
327   public GcCycleStats setDeleted(long deleted) {
328     this.deleted = deleted;
329     setDeletedIsSet(true);
330     return this;
331   }
332 
333   public void unsetDeleted() {
334     __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __DELETED_ISSET_ID);
335   }
336 
337   /** Returns true if field deleted is set (has been assigned a value) and false otherwise */
338   public boolean isSetDeleted() {
339     return EncodingUtils.testBit(__isset_bitfield, __DELETED_ISSET_ID);
340   }
341 
342   public void setDeletedIsSet(boolean value) {
343     __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __DELETED_ISSET_ID, value);
344   }
345 
346   public long getErrors() {
347     return this.errors;
348   }
349 
350   public GcCycleStats setErrors(long errors) {
351     this.errors = errors;
352     setErrorsIsSet(true);
353     return this;
354   }
355 
356   public void unsetErrors() {
357     __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ERRORS_ISSET_ID);
358   }
359 
360   /** Returns true if field errors is set (has been assigned a value) and false otherwise */
361   public boolean isSetErrors() {
362     return EncodingUtils.testBit(__isset_bitfield, __ERRORS_ISSET_ID);
363   }
364 
365   public void setErrorsIsSet(boolean value) {
366     __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ERRORS_ISSET_ID, value);
367   }
368 
369   public void setFieldValue(_Fields field, Object value) {
370     switch (field) {
371     case STARTED:
372       if (value == null) {
373         unsetStarted();
374       } else {
375         setStarted((Long)value);
376       }
377       break;
378 
379     case FINISHED:
380       if (value == null) {
381         unsetFinished();
382       } else {
383         setFinished((Long)value);
384       }
385       break;
386 
387     case CANDIDATES:
388       if (value == null) {
389         unsetCandidates();
390       } else {
391         setCandidates((Long)value);
392       }
393       break;
394 
395     case IN_USE:
396       if (value == null) {
397         unsetInUse();
398       } else {
399         setInUse((Long)value);
400       }
401       break;
402 
403     case DELETED:
404       if (value == null) {
405         unsetDeleted();
406       } else {
407         setDeleted((Long)value);
408       }
409       break;
410 
411     case ERRORS:
412       if (value == null) {
413         unsetErrors();
414       } else {
415         setErrors((Long)value);
416       }
417       break;
418 
419     }
420   }
421 
422   public Object getFieldValue(_Fields field) {
423     switch (field) {
424     case STARTED:
425       return Long.valueOf(getStarted());
426 
427     case FINISHED:
428       return Long.valueOf(getFinished());
429 
430     case CANDIDATES:
431       return Long.valueOf(getCandidates());
432 
433     case IN_USE:
434       return Long.valueOf(getInUse());
435 
436     case DELETED:
437       return Long.valueOf(getDeleted());
438 
439     case ERRORS:
440       return Long.valueOf(getErrors());
441 
442     }
443     throw new IllegalStateException();
444   }
445 
446   /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
447   public boolean isSet(_Fields field) {
448     if (field == null) {
449       throw new IllegalArgumentException();
450     }
451 
452     switch (field) {
453     case STARTED:
454       return isSetStarted();
455     case FINISHED:
456       return isSetFinished();
457     case CANDIDATES:
458       return isSetCandidates();
459     case IN_USE:
460       return isSetInUse();
461     case DELETED:
462       return isSetDeleted();
463     case ERRORS:
464       return isSetErrors();
465     }
466     throw new IllegalStateException();
467   }
468 
469   @Override
470   public boolean equals(Object that) {
471     if (that == null)
472       return false;
473     if (that instanceof GcCycleStats)
474       return this.equals((GcCycleStats)that);
475     return false;
476   }
477 
478   public boolean equals(GcCycleStats that) {
479     if (that == null)
480       return false;
481 
482     boolean this_present_started = true;
483     boolean that_present_started = true;
484     if (this_present_started || that_present_started) {
485       if (!(this_present_started && that_present_started))
486         return false;
487       if (this.started != that.started)
488         return false;
489     }
490 
491     boolean this_present_finished = true;
492     boolean that_present_finished = true;
493     if (this_present_finished || that_present_finished) {
494       if (!(this_present_finished && that_present_finished))
495         return false;
496       if (this.finished != that.finished)
497         return false;
498     }
499 
500     boolean this_present_candidates = true;
501     boolean that_present_candidates = true;
502     if (this_present_candidates || that_present_candidates) {
503       if (!(this_present_candidates && that_present_candidates))
504         return false;
505       if (this.candidates != that.candidates)
506         return false;
507     }
508 
509     boolean this_present_inUse = true;
510     boolean that_present_inUse = true;
511     if (this_present_inUse || that_present_inUse) {
512       if (!(this_present_inUse && that_present_inUse))
513         return false;
514       if (this.inUse != that.inUse)
515         return false;
516     }
517 
518     boolean this_present_deleted = true;
519     boolean that_present_deleted = true;
520     if (this_present_deleted || that_present_deleted) {
521       if (!(this_present_deleted && that_present_deleted))
522         return false;
523       if (this.deleted != that.deleted)
524         return false;
525     }
526 
527     boolean this_present_errors = true;
528     boolean that_present_errors = true;
529     if (this_present_errors || that_present_errors) {
530       if (!(this_present_errors && that_present_errors))
531         return false;
532       if (this.errors != that.errors)
533         return false;
534     }
535 
536     return true;
537   }
538 
539   @Override
540   public int hashCode() {
541     return 0;
542   }
543 
544   public int compareTo(GcCycleStats other) {
545     if (!getClass().equals(other.getClass())) {
546       return getClass().getName().compareTo(other.getClass().getName());
547     }
548 
549     int lastComparison = 0;
550     GcCycleStats typedOther = (GcCycleStats)other;
551 
552     lastComparison = Boolean.valueOf(isSetStarted()).compareTo(typedOther.isSetStarted());
553     if (lastComparison != 0) {
554       return lastComparison;
555     }
556     if (isSetStarted()) {
557       lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.started, typedOther.started);
558       if (lastComparison != 0) {
559         return lastComparison;
560       }
561     }
562     lastComparison = Boolean.valueOf(isSetFinished()).compareTo(typedOther.isSetFinished());
563     if (lastComparison != 0) {
564       return lastComparison;
565     }
566     if (isSetFinished()) {
567       lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.finished, typedOther.finished);
568       if (lastComparison != 0) {
569         return lastComparison;
570       }
571     }
572     lastComparison = Boolean.valueOf(isSetCandidates()).compareTo(typedOther.isSetCandidates());
573     if (lastComparison != 0) {
574       return lastComparison;
575     }
576     if (isSetCandidates()) {
577       lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.candidates, typedOther.candidates);
578       if (lastComparison != 0) {
579         return lastComparison;
580       }
581     }
582     lastComparison = Boolean.valueOf(isSetInUse()).compareTo(typedOther.isSetInUse());
583     if (lastComparison != 0) {
584       return lastComparison;
585     }
586     if (isSetInUse()) {
587       lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.inUse, typedOther.inUse);
588       if (lastComparison != 0) {
589         return lastComparison;
590       }
591     }
592     lastComparison = Boolean.valueOf(isSetDeleted()).compareTo(typedOther.isSetDeleted());
593     if (lastComparison != 0) {
594       return lastComparison;
595     }
596     if (isSetDeleted()) {
597       lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.deleted, typedOther.deleted);
598       if (lastComparison != 0) {
599         return lastComparison;
600       }
601     }
602     lastComparison = Boolean.valueOf(isSetErrors()).compareTo(typedOther.isSetErrors());
603     if (lastComparison != 0) {
604       return lastComparison;
605     }
606     if (isSetErrors()) {
607       lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.errors, typedOther.errors);
608       if (lastComparison != 0) {
609         return lastComparison;
610       }
611     }
612     return 0;
613   }
614 
615   public _Fields fieldForId(int fieldId) {
616     return _Fields.findByThriftId(fieldId);
617   }
618 
619   public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
620     schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
621   }
622 
623   public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
624     schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
625   }
626 
627   @Override
628   public String toString() {
629     StringBuilder sb = new StringBuilder("GcCycleStats(");
630     boolean first = true;
631 
632     sb.append("started:");
633     sb.append(this.started);
634     first = false;
635     if (!first) sb.append(", ");
636     sb.append("finished:");
637     sb.append(this.finished);
638     first = false;
639     if (!first) sb.append(", ");
640     sb.append("candidates:");
641     sb.append(this.candidates);
642     first = false;
643     if (!first) sb.append(", ");
644     sb.append("inUse:");
645     sb.append(this.inUse);
646     first = false;
647     if (!first) sb.append(", ");
648     sb.append("deleted:");
649     sb.append(this.deleted);
650     first = false;
651     if (!first) sb.append(", ");
652     sb.append("errors:");
653     sb.append(this.errors);
654     first = false;
655     sb.append(")");
656     return sb.toString();
657   }
658 
659   public void validate() throws org.apache.thrift.TException {
660     // check for required fields
661     // check for sub-struct validity
662   }
663 
664   private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
665     try {
666       write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
667     } catch (org.apache.thrift.TException te) {
668       throw new java.io.IOException(te);
669     }
670   }
671 
672   private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
673     try {
674       // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
675       __isset_bitfield = 0;
676       read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
677     } catch (org.apache.thrift.TException te) {
678       throw new java.io.IOException(te);
679     }
680   }
681 
682   private static class GcCycleStatsStandardSchemeFactory implements SchemeFactory {
683     public GcCycleStatsStandardScheme getScheme() {
684       return new GcCycleStatsStandardScheme();
685     }
686   }
687 
688   private static class GcCycleStatsStandardScheme extends StandardScheme<GcCycleStats> {
689 
690     public void read(org.apache.thrift.protocol.TProtocol iprot, GcCycleStats struct) throws org.apache.thrift.TException {
691       org.apache.thrift.protocol.TField schemeField;
692       iprot.readStructBegin();
693       while (true)
694       {
695         schemeField = iprot.readFieldBegin();
696         if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
697           break;
698         }
699         switch (schemeField.id) {
700           case 1: // STARTED
701             if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
702               struct.started = iprot.readI64();
703               struct.setStartedIsSet(true);
704             } else { 
705               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
706             }
707             break;
708           case 2: // FINISHED
709             if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
710               struct.finished = iprot.readI64();
711               struct.setFinishedIsSet(true);
712             } else { 
713               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
714             }
715             break;
716           case 3: // CANDIDATES
717             if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
718               struct.candidates = iprot.readI64();
719               struct.setCandidatesIsSet(true);
720             } else { 
721               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
722             }
723             break;
724           case 4: // IN_USE
725             if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
726               struct.inUse = iprot.readI64();
727               struct.setInUseIsSet(true);
728             } else { 
729               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
730             }
731             break;
732           case 5: // DELETED
733             if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
734               struct.deleted = iprot.readI64();
735               struct.setDeletedIsSet(true);
736             } else { 
737               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
738             }
739             break;
740           case 6: // ERRORS
741             if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
742               struct.errors = iprot.readI64();
743               struct.setErrorsIsSet(true);
744             } else { 
745               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
746             }
747             break;
748           default:
749             org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
750         }
751         iprot.readFieldEnd();
752       }
753       iprot.readStructEnd();
754 
755       // check for required fields of primitive type, which can't be checked in the validate method
756       struct.validate();
757     }
758 
759     public void write(org.apache.thrift.protocol.TProtocol oprot, GcCycleStats struct) throws org.apache.thrift.TException {
760       struct.validate();
761 
762       oprot.writeStructBegin(STRUCT_DESC);
763       oprot.writeFieldBegin(STARTED_FIELD_DESC);
764       oprot.writeI64(struct.started);
765       oprot.writeFieldEnd();
766       oprot.writeFieldBegin(FINISHED_FIELD_DESC);
767       oprot.writeI64(struct.finished);
768       oprot.writeFieldEnd();
769       oprot.writeFieldBegin(CANDIDATES_FIELD_DESC);
770       oprot.writeI64(struct.candidates);
771       oprot.writeFieldEnd();
772       oprot.writeFieldBegin(IN_USE_FIELD_DESC);
773       oprot.writeI64(struct.inUse);
774       oprot.writeFieldEnd();
775       oprot.writeFieldBegin(DELETED_FIELD_DESC);
776       oprot.writeI64(struct.deleted);
777       oprot.writeFieldEnd();
778       oprot.writeFieldBegin(ERRORS_FIELD_DESC);
779       oprot.writeI64(struct.errors);
780       oprot.writeFieldEnd();
781       oprot.writeFieldStop();
782       oprot.writeStructEnd();
783     }
784 
785   }
786 
787   private static class GcCycleStatsTupleSchemeFactory implements SchemeFactory {
788     public GcCycleStatsTupleScheme getScheme() {
789       return new GcCycleStatsTupleScheme();
790     }
791   }
792 
793   private static class GcCycleStatsTupleScheme extends TupleScheme<GcCycleStats> {
794 
795     @Override
796     public void write(org.apache.thrift.protocol.TProtocol prot, GcCycleStats struct) throws org.apache.thrift.TException {
797       TTupleProtocol oprot = (TTupleProtocol) prot;
798       BitSet optionals = new BitSet();
799       if (struct.isSetStarted()) {
800         optionals.set(0);
801       }
802       if (struct.isSetFinished()) {
803         optionals.set(1);
804       }
805       if (struct.isSetCandidates()) {
806         optionals.set(2);
807       }
808       if (struct.isSetInUse()) {
809         optionals.set(3);
810       }
811       if (struct.isSetDeleted()) {
812         optionals.set(4);
813       }
814       if (struct.isSetErrors()) {
815         optionals.set(5);
816       }
817       oprot.writeBitSet(optionals, 6);
818       if (struct.isSetStarted()) {
819         oprot.writeI64(struct.started);
820       }
821       if (struct.isSetFinished()) {
822         oprot.writeI64(struct.finished);
823       }
824       if (struct.isSetCandidates()) {
825         oprot.writeI64(struct.candidates);
826       }
827       if (struct.isSetInUse()) {
828         oprot.writeI64(struct.inUse);
829       }
830       if (struct.isSetDeleted()) {
831         oprot.writeI64(struct.deleted);
832       }
833       if (struct.isSetErrors()) {
834         oprot.writeI64(struct.errors);
835       }
836     }
837 
838     @Override
839     public void read(org.apache.thrift.protocol.TProtocol prot, GcCycleStats struct) throws org.apache.thrift.TException {
840       TTupleProtocol iprot = (TTupleProtocol) prot;
841       BitSet incoming = iprot.readBitSet(6);
842       if (incoming.get(0)) {
843         struct.started = iprot.readI64();
844         struct.setStartedIsSet(true);
845       }
846       if (incoming.get(1)) {
847         struct.finished = iprot.readI64();
848         struct.setFinishedIsSet(true);
849       }
850       if (incoming.get(2)) {
851         struct.candidates = iprot.readI64();
852         struct.setCandidatesIsSet(true);
853       }
854       if (incoming.get(3)) {
855         struct.inUse = iprot.readI64();
856         struct.setInUseIsSet(true);
857       }
858       if (incoming.get(4)) {
859         struct.deleted = iprot.readI64();
860         struct.setDeletedIsSet(true);
861       }
862       if (incoming.get(5)) {
863         struct.errors = iprot.readI64();
864         struct.setErrorsIsSet(true);
865       }
866     }
867   }
868 
869 }
870