/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You 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 org.apache.accumulo.core.data.thrift;

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;

@SuppressWarnings({"unchecked", "serial", "rawtypes", "unused"}) public class UpdateErrors implements org.apache.thrift.TBase<UpdateErrors, UpdateErrors._Fields>, java.io.Serializable, Cloneable, Comparable<UpdateErrors> {
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("UpdateErrors");

  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);
  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);
  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);

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

  public Map<TKeyExtent,Long> failedExtents; // required
  public List<TConstraintViolationSummary> violationSummaries; // required
  public Map<TKeyExtent,org.apache.accumulo.core.client.impl.thrift.SecurityErrorCode> authorizationFailures; // 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 {
    FAILED_EXTENTS((short)1, "failedExtents"),
    VIOLATION_SUMMARIES((short)2, "violationSummaries"),
    AUTHORIZATION_FAILURES((short)3, "authorizationFailures");

    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: // FAILED_EXTENTS
          return FAILED_EXTENTS;
        case 2: // VIOLATION_SUMMARIES
          return VIOLATION_SUMMARIES;
        case 3: // AUTHORIZATION_FAILURES
          return AUTHORIZATION_FAILURES;
        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
  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.FAILED_EXTENTS, new org.apache.thrift.meta_data.FieldMetaData("failedExtents", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, 
            new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TKeyExtent.class), 
            new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))));
    tmpMap.put(_Fields.VIOLATION_SUMMARIES, new org.apache.thrift.meta_data.FieldMetaData("violationSummaries", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
            new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TConstraintViolationSummary.class))));
    tmpMap.put(_Fields.AUTHORIZATION_FAILURES, new org.apache.thrift.meta_data.FieldMetaData("authorizationFailures", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, 
            new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TKeyExtent.class), 
            new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, org.apache.accumulo.core.client.impl.thrift.SecurityErrorCode.class))));
    metaDataMap = Collections.unmodifiableMap(tmpMap);
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(UpdateErrors.class, metaDataMap);
  }

  public UpdateErrors() {
  }

  public UpdateErrors(
    Map<TKeyExtent,Long> failedExtents,
    List<TConstraintViolationSummary> violationSummaries,
    Map<TKeyExtent,org.apache.accumulo.core.client.impl.thrift.SecurityErrorCode> authorizationFailures)
  {
    this();
    this.failedExtents = failedExtents;
    this.violationSummaries = violationSummaries;
    this.authorizationFailures = authorizationFailures;
  }

  /**
   * Performs a deep copy on <i>other</i>.
   */
  public UpdateErrors(UpdateErrors other) {
    if (other.isSetFailedExtents()) {
      Map<TKeyExtent,Long> __this__failedExtents = new HashMap<TKeyExtent,Long>(other.failedExtents.size());
      for (Map.Entry<TKeyExtent, Long> other_element : other.failedExtents.entrySet()) {

        TKeyExtent other_element_key = other_element.getKey();
        Long other_element_value = other_element.getValue();

        TKeyExtent __this__failedExtents_copy_key = new TKeyExtent(other_element_key);

        Long __this__failedExtents_copy_value = other_element_value;

        __this__failedExtents.put(__this__failedExtents_copy_key, __this__failedExtents_copy_value);
      }
      this.failedExtents = __this__failedExtents;
    }
    if (other.isSetViolationSummaries()) {
      List<TConstraintViolationSummary> __this__violationSummaries = new ArrayList<TConstraintViolationSummary>(other.violationSummaries.size());
      for (TConstraintViolationSummary other_element : other.violationSummaries) {
        __this__violationSummaries.add(new TConstraintViolationSummary(other_element));
      }
      this.violationSummaries = __this__violationSummaries;
    }
    if (other.isSetAuthorizationFailures()) {
      Map<TKeyExtent,org.apache.accumulo.core.client.impl.thrift.SecurityErrorCode> __this__authorizationFailures = new HashMap<TKeyExtent,org.apache.accumulo.core.client.impl.thrift.SecurityErrorCode>(other.authorizationFailures.size());
      for (Map.Entry<TKeyExtent, org.apache.accumulo.core.client.impl.thrift.SecurityErrorCode> other_element : other.authorizationFailures.entrySet()) {

        TKeyExtent other_element_key = other_element.getKey();
        org.apache.accumulo.core.client.impl.thrift.SecurityErrorCode other_element_value = other_element.getValue();

        TKeyExtent __this__authorizationFailures_copy_key = new TKeyExtent(other_element_key);

        org.apache.accumulo.core.client.impl.thrift.SecurityErrorCode __this__authorizationFailures_copy_value = other_element_value;

        __this__authorizationFailures.put(__this__authorizationFailures_copy_key, __this__authorizationFailures_copy_value);
      }
      this.authorizationFailures = __this__authorizationFailures;
    }
  }

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

  @Override
  public void clear() {
    this.failedExtents = null;
    this.violationSummaries = null;
    this.authorizationFailures = null;
  }

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

  public void putToFailedExtents(TKeyExtent key, long val) {
    if (this.failedExtents == null) {
      this.failedExtents = new HashMap<TKeyExtent,Long>();
    }
    this.failedExtents.put(key, val);
  }

  public Map<TKeyExtent,Long> getFailedExtents() {
    return this.failedExtents;
  }

  public UpdateErrors setFailedExtents(Map<TKeyExtent,Long> failedExtents) {
    this.failedExtents = failedExtents;
    return this;
  }

  public void unsetFailedExtents() {
    this.failedExtents = null;
  }

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

  public void setFailedExtentsIsSet(boolean value) {
    if (!value) {
      this.failedExtents = null;
    }
  }

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

  public java.util.Iterator<TConstraintViolationSummary> getViolationSummariesIterator() {
    return (this.violationSummaries == null) ? null : this.violationSummaries.iterator();
  }

  public void addToViolationSummaries(TConstraintViolationSummary elem) {
    if (this.violationSummaries == null) {
      this.violationSummaries = new ArrayList<TConstraintViolationSummary>();
    }
    this.violationSummaries.add(elem);
  }

  public List<TConstraintViolationSummary> getViolationSummaries() {
    return this.violationSummaries;
  }

  public UpdateErrors setViolationSummaries(List<TConstraintViolationSummary> violationSummaries) {
    this.violationSummaries = violationSummaries;
    return this;
  }

  public void unsetViolationSummaries() {
    this.violationSummaries = null;
  }

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

  public void setViolationSummariesIsSet(boolean value) {
    if (!value) {
      this.violationSummaries = null;
    }
  }

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

  public void putToAuthorizationFailures(TKeyExtent key, org.apache.accumulo.core.client.impl.thrift.SecurityErrorCode val) {
    if (this.authorizationFailures == null) {
      this.authorizationFailures = new HashMap<TKeyExtent,org.apache.accumulo.core.client.impl.thrift.SecurityErrorCode>();
    }
    this.authorizationFailures.put(key, val);
  }

  public Map<TKeyExtent,org.apache.accumulo.core.client.impl.thrift.SecurityErrorCode> getAuthorizationFailures() {
    return this.authorizationFailures;
  }

  public UpdateErrors setAuthorizationFailures(Map<TKeyExtent,org.apache.accumulo.core.client.impl.thrift.SecurityErrorCode> authorizationFailures) {
    this.authorizationFailures = authorizationFailures;
    return this;
  }

  public void unsetAuthorizationFailures() {
    this.authorizationFailures = null;
  }

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

  public void setAuthorizationFailuresIsSet(boolean value) {
    if (!value) {
      this.authorizationFailures = null;
    }
  }

  public void setFieldValue(_Fields field, Object value) {
    switch (field) {
    case FAILED_EXTENTS:
      if (value == null) {
        unsetFailedExtents();
      } else {
        setFailedExtents((Map<TKeyExtent,Long>)value);
      }
      break;

    case VIOLATION_SUMMARIES:
      if (value == null) {
        unsetViolationSummaries();
      } else {
        setViolationSummaries((List<TConstraintViolationSummary>)value);
      }
      break;

    case AUTHORIZATION_FAILURES:
      if (value == null) {
        unsetAuthorizationFailures();
      } else {
        setAuthorizationFailures((Map<TKeyExtent,org.apache.accumulo.core.client.impl.thrift.SecurityErrorCode>)value);
      }
      break;

    }
  }

  public Object getFieldValue(_Fields field) {
    switch (field) {
    case FAILED_EXTENTS:
      return getFailedExtents();

    case VIOLATION_SUMMARIES:
      return getViolationSummaries();

    case AUTHORIZATION_FAILURES:
      return getAuthorizationFailures();

    }
    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 FAILED_EXTENTS:
      return isSetFailedExtents();
    case VIOLATION_SUMMARIES:
      return isSetViolationSummaries();
    case AUTHORIZATION_FAILURES:
      return isSetAuthorizationFailures();
    }
    throw new IllegalStateException();
  }

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

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

    boolean this_present_failedExtents = true && this.isSetFailedExtents();
    boolean that_present_failedExtents = true && that.isSetFailedExtents();
    if (this_present_failedExtents || that_present_failedExtents) {
      if (!(this_present_failedExtents && that_present_failedExtents))
        return false;
      if (!this.failedExtents.equals(that.failedExtents))
        return false;
    }

    boolean this_present_violationSummaries = true && this.isSetViolationSummaries();
    boolean that_present_violationSummaries = true && that.isSetViolationSummaries();
    if (this_present_violationSummaries || that_present_violationSummaries) {
      if (!(this_present_violationSummaries && that_present_violationSummaries))
        return false;
      if (!this.violationSummaries.equals(that.violationSummaries))
        return false;
    }

    boolean this_present_authorizationFailures = true && this.isSetAuthorizationFailures();
    boolean that_present_authorizationFailures = true && that.isSetAuthorizationFailures();
    if (this_present_authorizationFailures || that_present_authorizationFailures) {
      if (!(this_present_authorizationFailures && that_present_authorizationFailures))
        return false;
      if (!this.authorizationFailures.equals(that.authorizationFailures))
        return false;
    }

    return true;
  }

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

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

    int lastComparison = 0;

    lastComparison = Boolean.valueOf(isSetFailedExtents()).compareTo(other.isSetFailedExtents());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetFailedExtents()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.failedExtents, other.failedExtents);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetViolationSummaries()).compareTo(other.isSetViolationSummaries());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetViolationSummaries()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.violationSummaries, other.violationSummaries);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetAuthorizationFailures()).compareTo(other.isSetAuthorizationFailures());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetAuthorizationFailures()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.authorizationFailures, other.authorizationFailures);
      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("UpdateErrors(");
    boolean first = true;

    sb.append("failedExtents:");
    if (this.failedExtents == null) {
      sb.append("null");
    } else {
      sb.append(this.failedExtents);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("violationSummaries:");
    if (this.violationSummaries == null) {
      sb.append("null");
    } else {
      sb.append(this.violationSummaries);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("authorizationFailures:");
    if (this.authorizationFailures == null) {
      sb.append("null");
    } else {
      sb.append(this.authorizationFailures);
    }
    first = false;
    sb.append(")");
    return sb.toString();
  }

  public void validate() throws org.apache.thrift.TException {
    // check for required fields
    // 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 {
      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 UpdateErrorsStandardSchemeFactory implements SchemeFactory {
    public UpdateErrorsStandardScheme getScheme() {
      return new UpdateErrorsStandardScheme();
    }
  }

  private static class UpdateErrorsStandardScheme extends StandardScheme<UpdateErrors> {

    public void read(org.apache.thrift.protocol.TProtocol iprot, UpdateErrors 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: // FAILED_EXTENTS
            if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
              {
                org.apache.thrift.protocol.TMap _map58 = iprot.readMapBegin();
                struct.failedExtents = new HashMap<TKeyExtent,Long>(2*_map58.size);
                for (int _i59 = 0; _i59 < _map58.size; ++_i59)
                {
                  TKeyExtent _key60;
                  long _val61;
                  _key60 = new TKeyExtent();
                  _key60.read(iprot);
                  _val61 = iprot.readI64();
                  struct.failedExtents.put(_key60, _val61);
                }
                iprot.readMapEnd();
              }
              struct.setFailedExtentsIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // VIOLATION_SUMMARIES
            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list62 = iprot.readListBegin();
                struct.violationSummaries = new ArrayList<TConstraintViolationSummary>(_list62.size);
                for (int _i63 = 0; _i63 < _list62.size; ++_i63)
                {
                  TConstraintViolationSummary _elem64;
                  _elem64 = new TConstraintViolationSummary();
                  _elem64.read(iprot);
                  struct.violationSummaries.add(_elem64);
                }
                iprot.readListEnd();
              }
              struct.setViolationSummariesIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // AUTHORIZATION_FAILURES
            if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
              {
                org.apache.thrift.protocol.TMap _map65 = iprot.readMapBegin();
                struct.authorizationFailures = new HashMap<TKeyExtent,org.apache.accumulo.core.client.impl.thrift.SecurityErrorCode>(2*_map65.size);
                for (int _i66 = 0; _i66 < _map65.size; ++_i66)
                {
                  TKeyExtent _key67;
                  org.apache.accumulo.core.client.impl.thrift.SecurityErrorCode _val68;
                  _key67 = new TKeyExtent();
                  _key67.read(iprot);
                  _val68 = org.apache.accumulo.core.client.impl.thrift.SecurityErrorCode.findByValue(iprot.readI32());
                  struct.authorizationFailures.put(_key67, _val68);
                }
                iprot.readMapEnd();
              }
              struct.setAuthorizationFailuresIsSet(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
      struct.validate();
    }

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

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.failedExtents != null) {
        oprot.writeFieldBegin(FAILED_EXTENTS_FIELD_DESC);
        {
          oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRUCT, org.apache.thrift.protocol.TType.I64, struct.failedExtents.size()));
          for (Map.Entry<TKeyExtent, Long> _iter69 : struct.failedExtents.entrySet())
          {
            _iter69.getKey().write(oprot);
            oprot.writeI64(_iter69.getValue());
          }
          oprot.writeMapEnd();
        }
        oprot.writeFieldEnd();
      }
      if (struct.violationSummaries != null) {
        oprot.writeFieldBegin(VIOLATION_SUMMARIES_FIELD_DESC);
        {
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.violationSummaries.size()));
          for (TConstraintViolationSummary _iter70 : struct.violationSummaries)
          {
            _iter70.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      }
      if (struct.authorizationFailures != null) {
        oprot.writeFieldBegin(AUTHORIZATION_FAILURES_FIELD_DESC);
        {
          oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRUCT, org.apache.thrift.protocol.TType.I32, struct.authorizationFailures.size()));
          for (Map.Entry<TKeyExtent, org.apache.accumulo.core.client.impl.thrift.SecurityErrorCode> _iter71 : struct.authorizationFailures.entrySet())
          {
            _iter71.getKey().write(oprot);
            oprot.writeI32(_iter71.getValue().getValue());
          }
          oprot.writeMapEnd();
        }
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

  }

  private static class UpdateErrorsTupleSchemeFactory implements SchemeFactory {
    public UpdateErrorsTupleScheme getScheme() {
      return new UpdateErrorsTupleScheme();
    }
  }

  private static class UpdateErrorsTupleScheme extends TupleScheme<UpdateErrors> {

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, UpdateErrors struct) throws org.apache.thrift.TException {
      TTupleProtocol oprot = (TTupleProtocol) prot;
      BitSet optionals = new BitSet();
      if (struct.isSetFailedExtents()) {
        optionals.set(0);
      }
      if (struct.isSetViolationSummaries()) {
        optionals.set(1);
      }
      if (struct.isSetAuthorizationFailures()) {
        optionals.set(2);
      }
      oprot.writeBitSet(optionals, 3);
      if (struct.isSetFailedExtents()) {
        {
          oprot.writeI32(struct.failedExtents.size());
          for (Map.Entry<TKeyExtent, Long> _iter72 : struct.failedExtents.entrySet())
          {
            _iter72.getKey().write(oprot);
            oprot.writeI64(_iter72.getValue());
          }
        }
      }
      if (struct.isSetViolationSummaries()) {
        {
          oprot.writeI32(struct.violationSummaries.size());
          for (TConstraintViolationSummary _iter73 : struct.violationSummaries)
          {
            _iter73.write(oprot);
          }
        }
      }
      if (struct.isSetAuthorizationFailures()) {
        {
          oprot.writeI32(struct.authorizationFailures.size());
          for (Map.Entry<TKeyExtent, org.apache.accumulo.core.client.impl.thrift.SecurityErrorCode> _iter74 : struct.authorizationFailures.entrySet())
          {
            _iter74.getKey().write(oprot);
            oprot.writeI32(_iter74.getValue().getValue());
          }
        }
      }
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, UpdateErrors struct) throws org.apache.thrift.TException {
      TTupleProtocol iprot = (TTupleProtocol) prot;
      BitSet incoming = iprot.readBitSet(3);
      if (incoming.get(0)) {
        {
          org.apache.thrift.protocol.TMap _map75 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRUCT, org.apache.thrift.protocol.TType.I64, iprot.readI32());
          struct.failedExtents = new HashMap<TKeyExtent,Long>(2*_map75.size);
          for (int _i76 = 0; _i76 < _map75.size; ++_i76)
          {
            TKeyExtent _key77;
            long _val78;
            _key77 = new TKeyExtent();
            _key77.read(iprot);
            _val78 = iprot.readI64();
            struct.failedExtents.put(_key77, _val78);
          }
        }
        struct.setFailedExtentsIsSet(true);
      }
      if (incoming.get(1)) {
        {
          org.apache.thrift.protocol.TList _list79 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
          struct.violationSummaries = new ArrayList<TConstraintViolationSummary>(_list79.size);
          for (int _i80 = 0; _i80 < _list79.size; ++_i80)
          {
            TConstraintViolationSummary _elem81;
            _elem81 = new TConstraintViolationSummary();
            _elem81.read(iprot);
            struct.violationSummaries.add(_elem81);
          }
        }
        struct.setViolationSummariesIsSet(true);
      }
      if (incoming.get(2)) {
        {
          org.apache.thrift.protocol.TMap _map82 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRUCT, org.apache.thrift.protocol.TType.I32, iprot.readI32());
          struct.authorizationFailures = new HashMap<TKeyExtent,org.apache.accumulo.core.client.impl.thrift.SecurityErrorCode>(2*_map82.size);
          for (int _i83 = 0; _i83 < _map82.size; ++_i83)
          {
            TKeyExtent _key84;
            org.apache.accumulo.core.client.impl.thrift.SecurityErrorCode _val85;
            _key84 = new TKeyExtent();
            _key84.read(iprot);
            _val85 = org.apache.accumulo.core.client.impl.thrift.SecurityErrorCode.findByValue(iprot.readI32());
            struct.authorizationFailures.put(_key84, _val85);
          }
        }
        struct.setAuthorizationFailuresIsSet(true);
      }
    }
  }

}

