ezbake.base.thrift.metrics.SnapShotThrift.java Source code

Java tutorial

Introduction

Here is the source code for ezbake.base.thrift.metrics.SnapShotThrift.java

Source

/*   Copyright (C) 2013-2014 Computer Sciences Corporation
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License. */

/**
 * Autogenerated by Thrift Compiler (0.9.1)
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated
 */
package ezbake.base.thrift.metrics;

import org.apache.thrift.scheme.IScheme;
import org.apache.thrift.scheme.SchemeFactory;
import org.apache.thrift.scheme.StandardScheme;

import org.apache.thrift.scheme.TupleScheme;
import org.apache.thrift.protocol.TTupleProtocol;
import org.apache.thrift.protocol.TProtocolException;
import org.apache.thrift.EncodingUtils;
import org.apache.thrift.TException;
import org.apache.thrift.async.AsyncMethodCallback;
import org.apache.thrift.server.AbstractNonblockingServer.*;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.util.HashMap;
import java.util.EnumMap;
import java.util.Set;
import java.util.HashSet;
import java.util.EnumSet;
import java.util.Collections;
import java.util.BitSet;
import java.nio.ByteBuffer;
import java.util.Arrays;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class SnapShotThrift implements org.apache.thrift.TBase<SnapShotThrift, SnapShotThrift._Fields>,
        java.io.Serializable, Cloneable, Comparable<SnapShotThrift> {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct(
            "SnapShotThrift");

    private static final org.apache.thrift.protocol.TField MAX_FIELD_DESC = new org.apache.thrift.protocol.TField(
            "max", org.apache.thrift.protocol.TType.I64, (short) 1);
    private static final org.apache.thrift.protocol.TField MIN_FIELD_DESC = new org.apache.thrift.protocol.TField(
            "min", org.apache.thrift.protocol.TType.I64, (short) 2);
    private static final org.apache.thrift.protocol.TField MEAN_FIELD_DESC = new org.apache.thrift.protocol.TField(
            "mean", org.apache.thrift.protocol.TType.DOUBLE, (short) 3);
    private static final org.apache.thrift.protocol.TField MEDIAN_FIELD_DESC = new org.apache.thrift.protocol.TField(
            "median", org.apache.thrift.protocol.TType.DOUBLE, (short) 4);
    private static final org.apache.thrift.protocol.TField STD_DEV_FIELD_DESC = new org.apache.thrift.protocol.TField(
            "StdDev", org.apache.thrift.protocol.TType.DOUBLE, (short) 5);
    private static final org.apache.thrift.protocol.TField P75_FIELD_DESC = new org.apache.thrift.protocol.TField(
            "p75", org.apache.thrift.protocol.TType.DOUBLE, (short) 6);
    private static final org.apache.thrift.protocol.TField P95_FIELD_DESC = new org.apache.thrift.protocol.TField(
            "p95", org.apache.thrift.protocol.TType.DOUBLE, (short) 7);
    private static final org.apache.thrift.protocol.TField P98_FIELD_DESC = new org.apache.thrift.protocol.TField(
            "p98", org.apache.thrift.protocol.TType.DOUBLE, (short) 8);
    private static final org.apache.thrift.protocol.TField P99_FIELD_DESC = new org.apache.thrift.protocol.TField(
            "p99", org.apache.thrift.protocol.TType.DOUBLE, (short) 9);
    private static final org.apache.thrift.protocol.TField P999_FIELD_DESC = new org.apache.thrift.protocol.TField(
            "p999", org.apache.thrift.protocol.TType.DOUBLE, (short) 10);
    private static final org.apache.thrift.protocol.TField VALUES_FIELD_DESC = new org.apache.thrift.protocol.TField(
            "values", org.apache.thrift.protocol.TType.LIST, (short) 11);

    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
    static {
        schemes.put(StandardScheme.class, new SnapShotThriftStandardSchemeFactory());
        schemes.put(TupleScheme.class, new SnapShotThriftTupleSchemeFactory());
    }

    public long max; // required
    public long min; // required
    public double mean; // required
    public double median; // required
    public double StdDev; // required
    public double p75; // required
    public double p95; // required
    public double p98; // required
    public double p99; // required
    public double p999; // required
    public List<Long> values; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
        MAX((short) 1, "max"), MIN((short) 2, "min"), MEAN((short) 3, "mean"), MEDIAN((short) 4, "median"), STD_DEV(
                (short) 5, "StdDev"), P75((short) 6, "p75"), P95((short) 7, "p95"), P98((short) 8,
                        "p98"), P99((short) 9, "p99"), P999((short) 10, "p999"), VALUES((short) 11, "values");

        private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

        static {
            for (_Fields field : EnumSet.allOf(_Fields.class)) {
                byName.put(field.getFieldName(), field);
            }
        }

        /**
         * Find the _Fields constant that matches fieldId, or null if its not found.
         */
        public static _Fields findByThriftId(int fieldId) {
            switch (fieldId) {
            case 1: // MAX
                return MAX;
            case 2: // MIN
                return MIN;
            case 3: // MEAN
                return MEAN;
            case 4: // MEDIAN
                return MEDIAN;
            case 5: // STD_DEV
                return STD_DEV;
            case 6: // P75
                return P75;
            case 7: // P95
                return P95;
            case 8: // P98
                return P98;
            case 9: // P99
                return P99;
            case 10: // P999
                return P999;
            case 11: // VALUES
                return VALUES;
            default:
                return null;
            }
        }

        /**
         * Find the _Fields constant that matches fieldId, throwing an exception
         * if it is not found.
         */
        public static _Fields findByThriftIdOrThrow(int fieldId) {
            _Fields fields = findByThriftId(fieldId);
            if (fields == null)
                throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
            return fields;
        }

        /**
         * Find the _Fields constant that matches name, or null if its not found.
         */
        public static _Fields findByName(String name) {
            return byName.get(name);
        }

        private final short _thriftId;
        private final String _fieldName;

        _Fields(short thriftId, String fieldName) {
            _thriftId = thriftId;
            _fieldName = fieldName;
        }

        public short getThriftFieldId() {
            return _thriftId;
        }

        public String getFieldName() {
            return _fieldName;
        }
    }

    // isset id assignments
    private static final int __MAX_ISSET_ID = 0;
    private static final int __MIN_ISSET_ID = 1;
    private static final int __MEAN_ISSET_ID = 2;
    private static final int __MEDIAN_ISSET_ID = 3;
    private static final int __STDDEV_ISSET_ID = 4;
    private static final int __P75_ISSET_ID = 5;
    private static final int __P95_ISSET_ID = 6;
    private static final int __P98_ISSET_ID = 7;
    private static final int __P99_ISSET_ID = 8;
    private static final int __P999_ISSET_ID = 9;
    private short __isset_bitfield = 0;
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
        Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(
                _Fields.class);
        tmpMap.put(_Fields.MAX,
                new org.apache.thrift.meta_data.FieldMetaData("max",
                        org.apache.thrift.TFieldRequirementType.REQUIRED,
                        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
        tmpMap.put(_Fields.MIN,
                new org.apache.thrift.meta_data.FieldMetaData("min",
                        org.apache.thrift.TFieldRequirementType.REQUIRED,
                        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
        tmpMap.put(_Fields.MEAN, new org.apache.thrift.meta_data.FieldMetaData("mean",
                org.apache.thrift.TFieldRequirementType.REQUIRED,
                new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
        tmpMap.put(_Fields.MEDIAN, new org.apache.thrift.meta_data.FieldMetaData("median",
                org.apache.thrift.TFieldRequirementType.REQUIRED,
                new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
        tmpMap.put(_Fields.STD_DEV, new org.apache.thrift.meta_data.FieldMetaData("StdDev",
                org.apache.thrift.TFieldRequirementType.REQUIRED,
                new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
        tmpMap.put(_Fields.P75, new org.apache.thrift.meta_data.FieldMetaData("p75",
                org.apache.thrift.TFieldRequirementType.REQUIRED,
                new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
        tmpMap.put(_Fields.P95, new org.apache.thrift.meta_data.FieldMetaData("p95",
                org.apache.thrift.TFieldRequirementType.REQUIRED,
                new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
        tmpMap.put(_Fields.P98, new org.apache.thrift.meta_data.FieldMetaData("p98",
                org.apache.thrift.TFieldRequirementType.REQUIRED,
                new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
        tmpMap.put(_Fields.P99, new org.apache.thrift.meta_data.FieldMetaData("p99",
                org.apache.thrift.TFieldRequirementType.REQUIRED,
                new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
        tmpMap.put(_Fields.P999, new org.apache.thrift.meta_data.FieldMetaData("p999",
                org.apache.thrift.TFieldRequirementType.REQUIRED,
                new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
        tmpMap.put(_Fields.VALUES, new org.apache.thrift.meta_data.FieldMetaData("values",
                org.apache.thrift.TFieldRequirementType.REQUIRED,
                new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,
                        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))));
        metaDataMap = Collections.unmodifiableMap(tmpMap);
        org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(SnapShotThrift.class, metaDataMap);
    }

    public SnapShotThrift() {
    }

    public SnapShotThrift(long max, long min, double mean, double median, double StdDev, double p75, double p95,
            double p98, double p99, double p999, List<Long> values) {
        this();
        this.max = max;
        setMaxIsSet(true);
        this.min = min;
        setMinIsSet(true);
        this.mean = mean;
        setMeanIsSet(true);
        this.median = median;
        setMedianIsSet(true);
        this.StdDev = StdDev;
        setStdDevIsSet(true);
        this.p75 = p75;
        setP75IsSet(true);
        this.p95 = p95;
        setP95IsSet(true);
        this.p98 = p98;
        setP98IsSet(true);
        this.p99 = p99;
        setP99IsSet(true);
        this.p999 = p999;
        setP999IsSet(true);
        this.values = values;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public SnapShotThrift(SnapShotThrift other) {
        __isset_bitfield = other.__isset_bitfield;
        this.max = other.max;
        this.min = other.min;
        this.mean = other.mean;
        this.median = other.median;
        this.StdDev = other.StdDev;
        this.p75 = other.p75;
        this.p95 = other.p95;
        this.p98 = other.p98;
        this.p99 = other.p99;
        this.p999 = other.p999;
        if (other.isSetValues()) {
            List<Long> __this__values = new ArrayList<Long>(other.values);
            this.values = __this__values;
        }
    }

    public SnapShotThrift deepCopy() {
        return new SnapShotThrift(this);
    }

    @Override
    public void clear() {
        setMaxIsSet(false);
        this.max = 0;
        setMinIsSet(false);
        this.min = 0;
        setMeanIsSet(false);
        this.mean = 0.0;
        setMedianIsSet(false);
        this.median = 0.0;
        setStdDevIsSet(false);
        this.StdDev = 0.0;
        setP75IsSet(false);
        this.p75 = 0.0;
        setP95IsSet(false);
        this.p95 = 0.0;
        setP98IsSet(false);
        this.p98 = 0.0;
        setP99IsSet(false);
        this.p99 = 0.0;
        setP999IsSet(false);
        this.p999 = 0.0;
        this.values = null;
    }

    public long getMax() {
        return this.max;
    }

    public SnapShotThrift setMax(long max) {
        this.max = max;
        setMaxIsSet(true);
        return this;
    }

    public void unsetMax() {
        __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __MAX_ISSET_ID);
    }

    /** Returns true if field max is set (has been assigned a value) and false otherwise */
    public boolean isSetMax() {
        return EncodingUtils.testBit(__isset_bitfield, __MAX_ISSET_ID);
    }

    public void setMaxIsSet(boolean value) {
        __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __MAX_ISSET_ID, value);
    }

    public long getMin() {
        return this.min;
    }

    public SnapShotThrift setMin(long min) {
        this.min = min;
        setMinIsSet(true);
        return this;
    }

    public void unsetMin() {
        __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __MIN_ISSET_ID);
    }

    /** Returns true if field min is set (has been assigned a value) and false otherwise */
    public boolean isSetMin() {
        return EncodingUtils.testBit(__isset_bitfield, __MIN_ISSET_ID);
    }

    public void setMinIsSet(boolean value) {
        __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __MIN_ISSET_ID, value);
    }

    public double getMean() {
        return this.mean;
    }

    public SnapShotThrift setMean(double mean) {
        this.mean = mean;
        setMeanIsSet(true);
        return this;
    }

    public void unsetMean() {
        __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __MEAN_ISSET_ID);
    }

    /** Returns true if field mean is set (has been assigned a value) and false otherwise */
    public boolean isSetMean() {
        return EncodingUtils.testBit(__isset_bitfield, __MEAN_ISSET_ID);
    }

    public void setMeanIsSet(boolean value) {
        __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __MEAN_ISSET_ID, value);
    }

    public double getMedian() {
        return this.median;
    }

    public SnapShotThrift setMedian(double median) {
        this.median = median;
        setMedianIsSet(true);
        return this;
    }

    public void unsetMedian() {
        __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __MEDIAN_ISSET_ID);
    }

    /** Returns true if field median is set (has been assigned a value) and false otherwise */
    public boolean isSetMedian() {
        return EncodingUtils.testBit(__isset_bitfield, __MEDIAN_ISSET_ID);
    }

    public void setMedianIsSet(boolean value) {
        __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __MEDIAN_ISSET_ID, value);
    }

    public double getStdDev() {
        return this.StdDev;
    }

    public SnapShotThrift setStdDev(double StdDev) {
        this.StdDev = StdDev;
        setStdDevIsSet(true);
        return this;
    }

    public void unsetStdDev() {
        __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __STDDEV_ISSET_ID);
    }

    /** Returns true if field StdDev is set (has been assigned a value) and false otherwise */
    public boolean isSetStdDev() {
        return EncodingUtils.testBit(__isset_bitfield, __STDDEV_ISSET_ID);
    }

    public void setStdDevIsSet(boolean value) {
        __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __STDDEV_ISSET_ID, value);
    }

    public double getP75() {
        return this.p75;
    }

    public SnapShotThrift setP75(double p75) {
        this.p75 = p75;
        setP75IsSet(true);
        return this;
    }

    public void unsetP75() {
        __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __P75_ISSET_ID);
    }

    /** Returns true if field p75 is set (has been assigned a value) and false otherwise */
    public boolean isSetP75() {
        return EncodingUtils.testBit(__isset_bitfield, __P75_ISSET_ID);
    }

    public void setP75IsSet(boolean value) {
        __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __P75_ISSET_ID, value);
    }

    public double getP95() {
        return this.p95;
    }

    public SnapShotThrift setP95(double p95) {
        this.p95 = p95;
        setP95IsSet(true);
        return this;
    }

    public void unsetP95() {
        __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __P95_ISSET_ID);
    }

    /** Returns true if field p95 is set (has been assigned a value) and false otherwise */
    public boolean isSetP95() {
        return EncodingUtils.testBit(__isset_bitfield, __P95_ISSET_ID);
    }

    public void setP95IsSet(boolean value) {
        __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __P95_ISSET_ID, value);
    }

    public double getP98() {
        return this.p98;
    }

    public SnapShotThrift setP98(double p98) {
        this.p98 = p98;
        setP98IsSet(true);
        return this;
    }

    public void unsetP98() {
        __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __P98_ISSET_ID);
    }

    /** Returns true if field p98 is set (has been assigned a value) and false otherwise */
    public boolean isSetP98() {
        return EncodingUtils.testBit(__isset_bitfield, __P98_ISSET_ID);
    }

    public void setP98IsSet(boolean value) {
        __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __P98_ISSET_ID, value);
    }

    public double getP99() {
        return this.p99;
    }

    public SnapShotThrift setP99(double p99) {
        this.p99 = p99;
        setP99IsSet(true);
        return this;
    }

    public void unsetP99() {
        __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __P99_ISSET_ID);
    }

    /** Returns true if field p99 is set (has been assigned a value) and false otherwise */
    public boolean isSetP99() {
        return EncodingUtils.testBit(__isset_bitfield, __P99_ISSET_ID);
    }

    public void setP99IsSet(boolean value) {
        __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __P99_ISSET_ID, value);
    }

    public double getP999() {
        return this.p999;
    }

    public SnapShotThrift setP999(double p999) {
        this.p999 = p999;
        setP999IsSet(true);
        return this;
    }

    public void unsetP999() {
        __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __P999_ISSET_ID);
    }

    /** Returns true if field p999 is set (has been assigned a value) and false otherwise */
    public boolean isSetP999() {
        return EncodingUtils.testBit(__isset_bitfield, __P999_ISSET_ID);
    }

    public void setP999IsSet(boolean value) {
        __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __P999_ISSET_ID, value);
    }

    public int getValuesSize() {
        return (this.values == null) ? 0 : this.values.size();
    }

    public java.util.Iterator<Long> getValuesIterator() {
        return (this.values == null) ? null : this.values.iterator();
    }

    public void addToValues(long elem) {
        if (this.values == null) {
            this.values = new ArrayList<Long>();
        }
        this.values.add(elem);
    }

    public List<Long> getValues() {
        return this.values;
    }

    public SnapShotThrift setValues(List<Long> values) {
        this.values = values;
        return this;
    }

    public void unsetValues() {
        this.values = null;
    }

    /** Returns true if field values is set (has been assigned a value) and false otherwise */
    public boolean isSetValues() {
        return this.values != null;
    }

    public void setValuesIsSet(boolean value) {
        if (!value) {
            this.values = null;
        }
    }

    public void setFieldValue(_Fields field, Object value) {
        switch (field) {
        case MAX:
            if (value == null) {
                unsetMax();
            } else {
                setMax((Long) value);
            }
            break;

        case MIN:
            if (value == null) {
                unsetMin();
            } else {
                setMin((Long) value);
            }
            break;

        case MEAN:
            if (value == null) {
                unsetMean();
            } else {
                setMean((Double) value);
            }
            break;

        case MEDIAN:
            if (value == null) {
                unsetMedian();
            } else {
                setMedian((Double) value);
            }
            break;

        case STD_DEV:
            if (value == null) {
                unsetStdDev();
            } else {
                setStdDev((Double) value);
            }
            break;

        case P75:
            if (value == null) {
                unsetP75();
            } else {
                setP75((Double) value);
            }
            break;

        case P95:
            if (value == null) {
                unsetP95();
            } else {
                setP95((Double) value);
            }
            break;

        case P98:
            if (value == null) {
                unsetP98();
            } else {
                setP98((Double) value);
            }
            break;

        case P99:
            if (value == null) {
                unsetP99();
            } else {
                setP99((Double) value);
            }
            break;

        case P999:
            if (value == null) {
                unsetP999();
            } else {
                setP999((Double) value);
            }
            break;

        case VALUES:
            if (value == null) {
                unsetValues();
            } else {
                setValues((List<Long>) value);
            }
            break;

        }
    }

    public Object getFieldValue(_Fields field) {
        switch (field) {
        case MAX:
            return Long.valueOf(getMax());

        case MIN:
            return Long.valueOf(getMin());

        case MEAN:
            return Double.valueOf(getMean());

        case MEDIAN:
            return Double.valueOf(getMedian());

        case STD_DEV:
            return Double.valueOf(getStdDev());

        case P75:
            return Double.valueOf(getP75());

        case P95:
            return Double.valueOf(getP95());

        case P98:
            return Double.valueOf(getP98());

        case P99:
            return Double.valueOf(getP99());

        case P999:
            return Double.valueOf(getP999());

        case VALUES:
            return getValues();

        }
        throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
        if (field == null) {
            throw new IllegalArgumentException();
        }

        switch (field) {
        case MAX:
            return isSetMax();
        case MIN:
            return isSetMin();
        case MEAN:
            return isSetMean();
        case MEDIAN:
            return isSetMedian();
        case STD_DEV:
            return isSetStdDev();
        case P75:
            return isSetP75();
        case P95:
            return isSetP95();
        case P98:
            return isSetP98();
        case P99:
            return isSetP99();
        case P999:
            return isSetP999();
        case VALUES:
            return isSetValues();
        }
        throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
        if (that == null)
            return false;
        if (that instanceof SnapShotThrift)
            return this.equals((SnapShotThrift) that);
        return false;
    }

    public boolean equals(SnapShotThrift that) {
        if (that == null)
            return false;

        boolean this_present_max = true;
        boolean that_present_max = true;
        if (this_present_max || that_present_max) {
            if (!(this_present_max && that_present_max))
                return false;
            if (this.max != that.max)
                return false;
        }

        boolean this_present_min = true;
        boolean that_present_min = true;
        if (this_present_min || that_present_min) {
            if (!(this_present_min && that_present_min))
                return false;
            if (this.min != that.min)
                return false;
        }

        boolean this_present_mean = true;
        boolean that_present_mean = true;
        if (this_present_mean || that_present_mean) {
            if (!(this_present_mean && that_present_mean))
                return false;
            if (this.mean != that.mean)
                return false;
        }

        boolean this_present_median = true;
        boolean that_present_median = true;
        if (this_present_median || that_present_median) {
            if (!(this_present_median && that_present_median))
                return false;
            if (this.median != that.median)
                return false;
        }

        boolean this_present_StdDev = true;
        boolean that_present_StdDev = true;
        if (this_present_StdDev || that_present_StdDev) {
            if (!(this_present_StdDev && that_present_StdDev))
                return false;
            if (this.StdDev != that.StdDev)
                return false;
        }

        boolean this_present_p75 = true;
        boolean that_present_p75 = true;
        if (this_present_p75 || that_present_p75) {
            if (!(this_present_p75 && that_present_p75))
                return false;
            if (this.p75 != that.p75)
                return false;
        }

        boolean this_present_p95 = true;
        boolean that_present_p95 = true;
        if (this_present_p95 || that_present_p95) {
            if (!(this_present_p95 && that_present_p95))
                return false;
            if (this.p95 != that.p95)
                return false;
        }

        boolean this_present_p98 = true;
        boolean that_present_p98 = true;
        if (this_present_p98 || that_present_p98) {
            if (!(this_present_p98 && that_present_p98))
                return false;
            if (this.p98 != that.p98)
                return false;
        }

        boolean this_present_p99 = true;
        boolean that_present_p99 = true;
        if (this_present_p99 || that_present_p99) {
            if (!(this_present_p99 && that_present_p99))
                return false;
            if (this.p99 != that.p99)
                return false;
        }

        boolean this_present_p999 = true;
        boolean that_present_p999 = true;
        if (this_present_p999 || that_present_p999) {
            if (!(this_present_p999 && that_present_p999))
                return false;
            if (this.p999 != that.p999)
                return false;
        }

        boolean this_present_values = true && this.isSetValues();
        boolean that_present_values = true && that.isSetValues();
        if (this_present_values || that_present_values) {
            if (!(this_present_values && that_present_values))
                return false;
            if (!this.values.equals(that.values))
                return false;
        }

        return true;
    }

    @Override
    public int hashCode() {
        return 0;
    }

    @Override
    public int compareTo(SnapShotThrift other) {
        if (!getClass().equals(other.getClass())) {
            return getClass().getName().compareTo(other.getClass().getName());
        }

        int lastComparison = 0;

        lastComparison = Boolean.valueOf(isSetMax()).compareTo(other.isSetMax());
        if (lastComparison != 0) {
            return lastComparison;
        }
        if (isSetMax()) {
            lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.max, other.max);
            if (lastComparison != 0) {
                return lastComparison;
            }
        }
        lastComparison = Boolean.valueOf(isSetMin()).compareTo(other.isSetMin());
        if (lastComparison != 0) {
            return lastComparison;
        }
        if (isSetMin()) {
            lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.min, other.min);
            if (lastComparison != 0) {
                return lastComparison;
            }
        }
        lastComparison = Boolean.valueOf(isSetMean()).compareTo(other.isSetMean());
        if (lastComparison != 0) {
            return lastComparison;
        }
        if (isSetMean()) {
            lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.mean, other.mean);
            if (lastComparison != 0) {
                return lastComparison;
            }
        }
        lastComparison = Boolean.valueOf(isSetMedian()).compareTo(other.isSetMedian());
        if (lastComparison != 0) {
            return lastComparison;
        }
        if (isSetMedian()) {
            lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.median, other.median);
            if (lastComparison != 0) {
                return lastComparison;
            }
        }
        lastComparison = Boolean.valueOf(isSetStdDev()).compareTo(other.isSetStdDev());
        if (lastComparison != 0) {
            return lastComparison;
        }
        if (isSetStdDev()) {
            lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.StdDev, other.StdDev);
            if (lastComparison != 0) {
                return lastComparison;
            }
        }
        lastComparison = Boolean.valueOf(isSetP75()).compareTo(other.isSetP75());
        if (lastComparison != 0) {
            return lastComparison;
        }
        if (isSetP75()) {
            lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.p75, other.p75);
            if (lastComparison != 0) {
                return lastComparison;
            }
        }
        lastComparison = Boolean.valueOf(isSetP95()).compareTo(other.isSetP95());
        if (lastComparison != 0) {
            return lastComparison;
        }
        if (isSetP95()) {
            lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.p95, other.p95);
            if (lastComparison != 0) {
                return lastComparison;
            }
        }
        lastComparison = Boolean.valueOf(isSetP98()).compareTo(other.isSetP98());
        if (lastComparison != 0) {
            return lastComparison;
        }
        if (isSetP98()) {
            lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.p98, other.p98);
            if (lastComparison != 0) {
                return lastComparison;
            }
        }
        lastComparison = Boolean.valueOf(isSetP99()).compareTo(other.isSetP99());
        if (lastComparison != 0) {
            return lastComparison;
        }
        if (isSetP99()) {
            lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.p99, other.p99);
            if (lastComparison != 0) {
                return lastComparison;
            }
        }
        lastComparison = Boolean.valueOf(isSetP999()).compareTo(other.isSetP999());
        if (lastComparison != 0) {
            return lastComparison;
        }
        if (isSetP999()) {
            lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.p999, other.p999);
            if (lastComparison != 0) {
                return lastComparison;
            }
        }
        lastComparison = Boolean.valueOf(isSetValues()).compareTo(other.isSetValues());
        if (lastComparison != 0) {
            return lastComparison;
        }
        if (isSetValues()) {
            lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.values, other.values);
            if (lastComparison != 0) {
                return lastComparison;
            }
        }
        return 0;
    }

    public _Fields fieldForId(int fieldId) {
        return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
        schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
        schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder("SnapShotThrift(");
        boolean first = true;

        sb.append("max:");
        sb.append(this.max);
        first = false;
        if (!first)
            sb.append(", ");
        sb.append("min:");
        sb.append(this.min);
        first = false;
        if (!first)
            sb.append(", ");
        sb.append("mean:");
        sb.append(this.mean);
        first = false;
        if (!first)
            sb.append(", ");
        sb.append("median:");
        sb.append(this.median);
        first = false;
        if (!first)
            sb.append(", ");
        sb.append("StdDev:");
        sb.append(this.StdDev);
        first = false;
        if (!first)
            sb.append(", ");
        sb.append("p75:");
        sb.append(this.p75);
        first = false;
        if (!first)
            sb.append(", ");
        sb.append("p95:");
        sb.append(this.p95);
        first = false;
        if (!first)
            sb.append(", ");
        sb.append("p98:");
        sb.append(this.p98);
        first = false;
        if (!first)
            sb.append(", ");
        sb.append("p99:");
        sb.append(this.p99);
        first = false;
        if (!first)
            sb.append(", ");
        sb.append("p999:");
        sb.append(this.p999);
        first = false;
        if (!first)
            sb.append(", ");
        sb.append("values:");
        if (this.values == null) {
            sb.append("null");
        } else {
            sb.append(this.values);
        }
        first = false;
        sb.append(")");
        return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
        // check for required fields
        // alas, we cannot check 'max' because it's a primitive and you chose the non-beans generator.
        // alas, we cannot check 'min' because it's a primitive and you chose the non-beans generator.
        // alas, we cannot check 'mean' because it's a primitive and you chose the non-beans generator.
        // alas, we cannot check 'median' because it's a primitive and you chose the non-beans generator.
        // alas, we cannot check 'StdDev' because it's a primitive and you chose the non-beans generator.
        // alas, we cannot check 'p75' because it's a primitive and you chose the non-beans generator.
        // alas, we cannot check 'p95' because it's a primitive and you chose the non-beans generator.
        // alas, we cannot check 'p98' because it's a primitive and you chose the non-beans generator.
        // alas, we cannot check 'p99' because it's a primitive and you chose the non-beans generator.
        // alas, we cannot check 'p999' because it's a primitive and you chose the non-beans generator.
        if (values == null) {
            throw new org.apache.thrift.protocol.TProtocolException(
                    "Required field 'values' was not present! Struct: " + toString());
        }
        // check for sub-struct validity
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
        try {
            write(new org.apache.thrift.protocol.TCompactProtocol(
                    new org.apache.thrift.transport.TIOStreamTransport(out)));
        } catch (org.apache.thrift.TException te) {
            throw new java.io.IOException(te);
        }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
        try {
            // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
            __isset_bitfield = 0;
            read(new org.apache.thrift.protocol.TCompactProtocol(
                    new org.apache.thrift.transport.TIOStreamTransport(in)));
        } catch (org.apache.thrift.TException te) {
            throw new java.io.IOException(te);
        }
    }

    private static class SnapShotThriftStandardSchemeFactory implements SchemeFactory {
        public SnapShotThriftStandardScheme getScheme() {
            return new SnapShotThriftStandardScheme();
        }
    }

    private static class SnapShotThriftStandardScheme extends StandardScheme<SnapShotThrift> {

        public void read(org.apache.thrift.protocol.TProtocol iprot, SnapShotThrift struct)
                throws org.apache.thrift.TException {
            org.apache.thrift.protocol.TField schemeField;
            iprot.readStructBegin();
            while (true) {
                schemeField = iprot.readFieldBegin();
                if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
                    break;
                }
                switch (schemeField.id) {
                case 1: // MAX
                    if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
                        struct.max = iprot.readI64();
                        struct.setMaxIsSet(true);
                    } else {
                        org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
                    }
                    break;
                case 2: // MIN
                    if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
                        struct.min = iprot.readI64();
                        struct.setMinIsSet(true);
                    } else {
                        org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
                    }
                    break;
                case 3: // MEAN
                    if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) {
                        struct.mean = iprot.readDouble();
                        struct.setMeanIsSet(true);
                    } else {
                        org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
                    }
                    break;
                case 4: // MEDIAN
                    if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) {
                        struct.median = iprot.readDouble();
                        struct.setMedianIsSet(true);
                    } else {
                        org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
                    }
                    break;
                case 5: // STD_DEV
                    if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) {
                        struct.StdDev = iprot.readDouble();
                        struct.setStdDevIsSet(true);
                    } else {
                        org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
                    }
                    break;
                case 6: // P75
                    if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) {
                        struct.p75 = iprot.readDouble();
                        struct.setP75IsSet(true);
                    } else {
                        org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
                    }
                    break;
                case 7: // P95
                    if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) {
                        struct.p95 = iprot.readDouble();
                        struct.setP95IsSet(true);
                    } else {
                        org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
                    }
                    break;
                case 8: // P98
                    if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) {
                        struct.p98 = iprot.readDouble();
                        struct.setP98IsSet(true);
                    } else {
                        org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
                    }
                    break;
                case 9: // P99
                    if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) {
                        struct.p99 = iprot.readDouble();
                        struct.setP99IsSet(true);
                    } else {
                        org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
                    }
                    break;
                case 10: // P999
                    if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) {
                        struct.p999 = iprot.readDouble();
                        struct.setP999IsSet(true);
                    } else {
                        org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
                    }
                    break;
                case 11: // VALUES
                    if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
                        {
                            org.apache.thrift.protocol.TList _list0 = iprot.readListBegin();
                            struct.values = new ArrayList<Long>(_list0.size);
                            for (int _i1 = 0; _i1 < _list0.size; ++_i1) {
                                long _elem2;
                                _elem2 = iprot.readI64();
                                struct.values.add(_elem2);
                            }
                            iprot.readListEnd();
                        }
                        struct.setValuesIsSet(true);
                    } else {
                        org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
                    }
                    break;
                default:
                    org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
                }
                iprot.readFieldEnd();
            }
            iprot.readStructEnd();

            // check for required fields of primitive type, which can't be checked in the validate method
            if (!struct.isSetMax()) {
                throw new org.apache.thrift.protocol.TProtocolException(
                        "Required field 'max' was not found in serialized data! Struct: " + toString());
            }
            if (!struct.isSetMin()) {
                throw new org.apache.thrift.protocol.TProtocolException(
                        "Required field 'min' was not found in serialized data! Struct: " + toString());
            }
            if (!struct.isSetMean()) {
                throw new org.apache.thrift.protocol.TProtocolException(
                        "Required field 'mean' was not found in serialized data! Struct: " + toString());
            }
            if (!struct.isSetMedian()) {
                throw new org.apache.thrift.protocol.TProtocolException(
                        "Required field 'median' was not found in serialized data! Struct: " + toString());
            }
            if (!struct.isSetStdDev()) {
                throw new org.apache.thrift.protocol.TProtocolException(
                        "Required field 'StdDev' was not found in serialized data! Struct: " + toString());
            }
            if (!struct.isSetP75()) {
                throw new org.apache.thrift.protocol.TProtocolException(
                        "Required field 'p75' was not found in serialized data! Struct: " + toString());
            }
            if (!struct.isSetP95()) {
                throw new org.apache.thrift.protocol.TProtocolException(
                        "Required field 'p95' was not found in serialized data! Struct: " + toString());
            }
            if (!struct.isSetP98()) {
                throw new org.apache.thrift.protocol.TProtocolException(
                        "Required field 'p98' was not found in serialized data! Struct: " + toString());
            }
            if (!struct.isSetP99()) {
                throw new org.apache.thrift.protocol.TProtocolException(
                        "Required field 'p99' was not found in serialized data! Struct: " + toString());
            }
            if (!struct.isSetP999()) {
                throw new org.apache.thrift.protocol.TProtocolException(
                        "Required field 'p999' was not found in serialized data! Struct: " + toString());
            }
            struct.validate();
        }

        public void write(org.apache.thrift.protocol.TProtocol oprot, SnapShotThrift struct)
                throws org.apache.thrift.TException {
            struct.validate();

            oprot.writeStructBegin(STRUCT_DESC);
            oprot.writeFieldBegin(MAX_FIELD_DESC);
            oprot.writeI64(struct.max);
            oprot.writeFieldEnd();
            oprot.writeFieldBegin(MIN_FIELD_DESC);
            oprot.writeI64(struct.min);
            oprot.writeFieldEnd();
            oprot.writeFieldBegin(MEAN_FIELD_DESC);
            oprot.writeDouble(struct.mean);
            oprot.writeFieldEnd();
            oprot.writeFieldBegin(MEDIAN_FIELD_DESC);
            oprot.writeDouble(struct.median);
            oprot.writeFieldEnd();
            oprot.writeFieldBegin(STD_DEV_FIELD_DESC);
            oprot.writeDouble(struct.StdDev);
            oprot.writeFieldEnd();
            oprot.writeFieldBegin(P75_FIELD_DESC);
            oprot.writeDouble(struct.p75);
            oprot.writeFieldEnd();
            oprot.writeFieldBegin(P95_FIELD_DESC);
            oprot.writeDouble(struct.p95);
            oprot.writeFieldEnd();
            oprot.writeFieldBegin(P98_FIELD_DESC);
            oprot.writeDouble(struct.p98);
            oprot.writeFieldEnd();
            oprot.writeFieldBegin(P99_FIELD_DESC);
            oprot.writeDouble(struct.p99);
            oprot.writeFieldEnd();
            oprot.writeFieldBegin(P999_FIELD_DESC);
            oprot.writeDouble(struct.p999);
            oprot.writeFieldEnd();
            if (struct.values != null) {
                oprot.writeFieldBegin(VALUES_FIELD_DESC);
                {
                    oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64,
                            struct.values.size()));
                    for (long _iter3 : struct.values) {
                        oprot.writeI64(_iter3);
                    }
                    oprot.writeListEnd();
                }
                oprot.writeFieldEnd();
            }
            oprot.writeFieldStop();
            oprot.writeStructEnd();
        }

    }

    private static class SnapShotThriftTupleSchemeFactory implements SchemeFactory {
        public SnapShotThriftTupleScheme getScheme() {
            return new SnapShotThriftTupleScheme();
        }
    }

    private static class SnapShotThriftTupleScheme extends TupleScheme<SnapShotThrift> {

        @Override
        public void write(org.apache.thrift.protocol.TProtocol prot, SnapShotThrift struct)
                throws org.apache.thrift.TException {
            TTupleProtocol oprot = (TTupleProtocol) prot;
            oprot.writeI64(struct.max);
            oprot.writeI64(struct.min);
            oprot.writeDouble(struct.mean);
            oprot.writeDouble(struct.median);
            oprot.writeDouble(struct.StdDev);
            oprot.writeDouble(struct.p75);
            oprot.writeDouble(struct.p95);
            oprot.writeDouble(struct.p98);
            oprot.writeDouble(struct.p99);
            oprot.writeDouble(struct.p999);
            {
                oprot.writeI32(struct.values.size());
                for (long _iter4 : struct.values) {
                    oprot.writeI64(_iter4);
                }
            }
        }

        @Override
        public void read(org.apache.thrift.protocol.TProtocol prot, SnapShotThrift struct)
                throws org.apache.thrift.TException {
            TTupleProtocol iprot = (TTupleProtocol) prot;
            struct.max = iprot.readI64();
            struct.setMaxIsSet(true);
            struct.min = iprot.readI64();
            struct.setMinIsSet(true);
            struct.mean = iprot.readDouble();
            struct.setMeanIsSet(true);
            struct.median = iprot.readDouble();
            struct.setMedianIsSet(true);
            struct.StdDev = iprot.readDouble();
            struct.setStdDevIsSet(true);
            struct.p75 = iprot.readDouble();
            struct.setP75IsSet(true);
            struct.p95 = iprot.readDouble();
            struct.setP95IsSet(true);
            struct.p98 = iprot.readDouble();
            struct.setP98IsSet(true);
            struct.p99 = iprot.readDouble();
            struct.setP99IsSet(true);
            struct.p999 = iprot.readDouble();
            struct.setP999IsSet(true);
            {
                org.apache.thrift.protocol.TList _list5 = new org.apache.thrift.protocol.TList(
                        org.apache.thrift.protocol.TType.I64, iprot.readI32());
                struct.values = new ArrayList<Long>(_list5.size);
                for (int _i6 = 0; _i6 < _list5.size; ++_i6) {
                    long _elem7;
                    _elem7 = iprot.readI64();
                    struct.values.add(_elem7);
                }
            }
            struct.setValuesIsSet(true);
        }
    }

}