All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.twitter.distributedlog.thrift.BKDLConfigFormat Maven / Gradle / Ivy

The newest version!
/**
 * Autogenerated by Thrift
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 */
package com.twitter.distributedlog.thrift;

import org.apache.commons.lang.builder.HashCodeBuilder;
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;

import org.apache.thrift.*;
import org.apache.thrift.async.*;
import org.apache.thrift.meta_data.*;
import org.apache.thrift.transport.*;
import org.apache.thrift.protocol.*;

// No additional import required for struct/union.

public class BKDLConfigFormat implements TBase, java.io.Serializable, Cloneable {
  private static final TStruct STRUCT_DESC = new TStruct("BKDLConfigFormat");

  private static final TField BK_ZK_SERVERS_FIELD_DESC = new TField("bkZkServers", TType.STRING, (short)1);
  private static final TField BK_LEDGERS_PATH_FIELD_DESC = new TField("bkLedgersPath", TType.STRING, (short)2);
  private static final TField SANITY_CHECK_TXN_ID_FIELD_DESC = new TField("sanityCheckTxnID", TType.BOOL, (short)3);
  private static final TField ENCODE_REGION_ID_FIELD_DESC = new TField("encodeRegionID", TType.BOOL, (short)4);
  private static final TField BK_ZK_SERVERS_FOR_READER_FIELD_DESC = new TField("bkZkServersForReader", TType.STRING, (short)5);
  private static final TField DL_ZK_SERVERS_FOR_WRITER_FIELD_DESC = new TField("dlZkServersForWriter", TType.STRING, (short)6);
  private static final TField DL_ZK_SERVERS_FOR_READER_FIELD_DESC = new TField("dlZkServersForReader", TType.STRING, (short)7);
  private static final TField ACL_ROOT_PATH_FIELD_DESC = new TField("aclRootPath", TType.STRING, (short)8);
  private static final TField FIRST_LOG_SEGMENT_SEQ_NO_FIELD_DESC = new TField("firstLogSegmentSeqNo", TType.I64, (short)9);
  private static final TField FEDERATED_NAMESPACE_FIELD_DESC = new TField("federatedNamespace", TType.BOOL, (short)10);


  public String bkZkServers;
  public String bkLedgersPath;
  public boolean sanityCheckTxnID;
  public boolean encodeRegionID;
  public String bkZkServersForReader;
  public String dlZkServersForWriter;
  public String dlZkServersForReader;
  public String aclRootPath;
  public long firstLogSegmentSeqNo;
  public boolean federatedNamespace;

  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
  public enum _Fields implements TFieldIdEnum {
    BK_ZK_SERVERS((short)1, "bkZkServers"),
    BK_LEDGERS_PATH((short)2, "bkLedgersPath"),
    SANITY_CHECK_TXN_ID((short)3, "sanityCheckTxnID"),
    ENCODE_REGION_ID((short)4, "encodeRegionID"),
    BK_ZK_SERVERS_FOR_READER((short)5, "bkZkServersForReader"),
    DL_ZK_SERVERS_FOR_WRITER((short)6, "dlZkServersForWriter"),
    DL_ZK_SERVERS_FOR_READER((short)7, "dlZkServersForReader"),
    ACL_ROOT_PATH((short)8, "aclRootPath"),
    FIRST_LOG_SEGMENT_SEQ_NO((short)9, "firstLogSegmentSeqNo"),
    FEDERATED_NAMESPACE((short)10, "federatedNamespace");
  
    private static final Map byName = new HashMap();
  
    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: // BK_ZK_SERVERS
  	return BK_ZK_SERVERS;
        case 2: // BK_LEDGERS_PATH
  	return BK_LEDGERS_PATH;
        case 3: // SANITY_CHECK_TXN_ID
  	return SANITY_CHECK_TXN_ID;
        case 4: // ENCODE_REGION_ID
  	return ENCODE_REGION_ID;
        case 5: // BK_ZK_SERVERS_FOR_READER
  	return BK_ZK_SERVERS_FOR_READER;
        case 6: // DL_ZK_SERVERS_FOR_WRITER
  	return DL_ZK_SERVERS_FOR_WRITER;
        case 7: // DL_ZK_SERVERS_FOR_READER
  	return DL_ZK_SERVERS_FOR_READER;
        case 8: // ACL_ROOT_PATH
  	return ACL_ROOT_PATH;
        case 9: // FIRST_LOG_SEGMENT_SEQ_NO
  	return FIRST_LOG_SEGMENT_SEQ_NO;
        case 10: // FEDERATED_NAMESPACE
  	return FEDERATED_NAMESPACE;
        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 __SANITYCHECKTXNID_ISSET_ID = 0;
  private static final int __ENCODEREGIONID_ISSET_ID = 1;
  private static final int __FIRSTLOGSEGMENTSEQNO_ISSET_ID = 2;
  private static final int __FEDERATEDNAMESPACE_ISSET_ID = 3;
  private BitSet __isset_bit_vector = new BitSet(4);

  public static final Map<_Fields, FieldMetaData> metaDataMap;
  static {
    Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class);
    tmpMap.put(_Fields.BK_ZK_SERVERS, new FieldMetaData("bkZkServers", TFieldRequirementType.OPTIONAL,
      new FieldValueMetaData(TType.STRING)));
    tmpMap.put(_Fields.BK_LEDGERS_PATH, new FieldMetaData("bkLedgersPath", TFieldRequirementType.OPTIONAL,
      new FieldValueMetaData(TType.STRING)));
    tmpMap.put(_Fields.SANITY_CHECK_TXN_ID, new FieldMetaData("sanityCheckTxnID", TFieldRequirementType.OPTIONAL,
      new FieldValueMetaData(TType.BOOL)));
    tmpMap.put(_Fields.ENCODE_REGION_ID, new FieldMetaData("encodeRegionID", TFieldRequirementType.OPTIONAL,
      new FieldValueMetaData(TType.BOOL)));
    tmpMap.put(_Fields.BK_ZK_SERVERS_FOR_READER, new FieldMetaData("bkZkServersForReader", TFieldRequirementType.OPTIONAL,
      new FieldValueMetaData(TType.STRING)));
    tmpMap.put(_Fields.DL_ZK_SERVERS_FOR_WRITER, new FieldMetaData("dlZkServersForWriter", TFieldRequirementType.OPTIONAL,
      new FieldValueMetaData(TType.STRING)));
    tmpMap.put(_Fields.DL_ZK_SERVERS_FOR_READER, new FieldMetaData("dlZkServersForReader", TFieldRequirementType.OPTIONAL,
      new FieldValueMetaData(TType.STRING)));
    tmpMap.put(_Fields.ACL_ROOT_PATH, new FieldMetaData("aclRootPath", TFieldRequirementType.OPTIONAL,
      new FieldValueMetaData(TType.STRING)));
    tmpMap.put(_Fields.FIRST_LOG_SEGMENT_SEQ_NO, new FieldMetaData("firstLogSegmentSeqNo", TFieldRequirementType.OPTIONAL,
      new FieldValueMetaData(TType.I64)));
    tmpMap.put(_Fields.FEDERATED_NAMESPACE, new FieldMetaData("federatedNamespace", TFieldRequirementType.OPTIONAL,
      new FieldValueMetaData(TType.BOOL)));
    metaDataMap = Collections.unmodifiableMap(tmpMap);
    FieldMetaData.addStructMetaDataMap(BKDLConfigFormat.class, metaDataMap);
  }


  public BKDLConfigFormat() {
  }


  /**
   * Performs a deep copy on other.
   */
  public BKDLConfigFormat(BKDLConfigFormat other) {
    __isset_bit_vector.clear();
    __isset_bit_vector.or(other.__isset_bit_vector);
    if (other.isSetBkZkServers()) {
      this.bkZkServers = other.bkZkServers;
    }
    if (other.isSetBkLedgersPath()) {
      this.bkLedgersPath = other.bkLedgersPath;
    }
    this.sanityCheckTxnID = other.sanityCheckTxnID;
    this.encodeRegionID = other.encodeRegionID;
    if (other.isSetBkZkServersForReader()) {
      this.bkZkServersForReader = other.bkZkServersForReader;
    }
    if (other.isSetDlZkServersForWriter()) {
      this.dlZkServersForWriter = other.dlZkServersForWriter;
    }
    if (other.isSetDlZkServersForReader()) {
      this.dlZkServersForReader = other.dlZkServersForReader;
    }
    if (other.isSetAclRootPath()) {
      this.aclRootPath = other.aclRootPath;
    }
    this.firstLogSegmentSeqNo = other.firstLogSegmentSeqNo;
    this.federatedNamespace = other.federatedNamespace;
  }

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

  @Override
  public void clear() {
    this.bkZkServers = null;
    this.bkLedgersPath = null;
    setSanityCheckTxnIDIsSet(false);
    this.sanityCheckTxnID = false;
    setEncodeRegionIDIsSet(false);
    this.encodeRegionID = false;
    this.bkZkServersForReader = null;
    this.dlZkServersForWriter = null;
    this.dlZkServersForReader = null;
    this.aclRootPath = null;
    setFirstLogSegmentSeqNoIsSet(false);
    this.firstLogSegmentSeqNo = 0;
    setFederatedNamespaceIsSet(false);
    this.federatedNamespace = false;
  }

  public String getBkZkServers() {
    return this.bkZkServers;
  }

  public BKDLConfigFormat setBkZkServers(String bkZkServers) {
    this.bkZkServers = bkZkServers;
    
    return this;
  }

  public void unsetBkZkServers() {
    this.bkZkServers = null;
  }

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

  public void setBkZkServersIsSet(boolean value) {
    if (!value) {
      this.bkZkServers = null;
    }
  }

  public String getBkLedgersPath() {
    return this.bkLedgersPath;
  }

  public BKDLConfigFormat setBkLedgersPath(String bkLedgersPath) {
    this.bkLedgersPath = bkLedgersPath;
    
    return this;
  }

  public void unsetBkLedgersPath() {
    this.bkLedgersPath = null;
  }

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

  public void setBkLedgersPathIsSet(boolean value) {
    if (!value) {
      this.bkLedgersPath = null;
    }
  }

  public boolean isSanityCheckTxnID() {
    return this.sanityCheckTxnID;
  }

  public BKDLConfigFormat setSanityCheckTxnID(boolean sanityCheckTxnID) {
    this.sanityCheckTxnID = sanityCheckTxnID;
    setSanityCheckTxnIDIsSet(true);

    return this;
  }

  public void unsetSanityCheckTxnID() {
  __isset_bit_vector.clear(__SANITYCHECKTXNID_ISSET_ID);
  }

  /** Returns true if field sanityCheckTxnID is set (has been asigned a value) and false otherwise */
  public boolean isSetSanityCheckTxnID() {
    return __isset_bit_vector.get(__SANITYCHECKTXNID_ISSET_ID);
  }

  public void setSanityCheckTxnIDIsSet(boolean value) {
    __isset_bit_vector.set(__SANITYCHECKTXNID_ISSET_ID, value);
  }

  public boolean isEncodeRegionID() {
    return this.encodeRegionID;
  }

  public BKDLConfigFormat setEncodeRegionID(boolean encodeRegionID) {
    this.encodeRegionID = encodeRegionID;
    setEncodeRegionIDIsSet(true);

    return this;
  }

  public void unsetEncodeRegionID() {
  __isset_bit_vector.clear(__ENCODEREGIONID_ISSET_ID);
  }

  /** Returns true if field encodeRegionID is set (has been asigned a value) and false otherwise */
  public boolean isSetEncodeRegionID() {
    return __isset_bit_vector.get(__ENCODEREGIONID_ISSET_ID);
  }

  public void setEncodeRegionIDIsSet(boolean value) {
    __isset_bit_vector.set(__ENCODEREGIONID_ISSET_ID, value);
  }

  public String getBkZkServersForReader() {
    return this.bkZkServersForReader;
  }

  public BKDLConfigFormat setBkZkServersForReader(String bkZkServersForReader) {
    this.bkZkServersForReader = bkZkServersForReader;
    
    return this;
  }

  public void unsetBkZkServersForReader() {
    this.bkZkServersForReader = null;
  }

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

  public void setBkZkServersForReaderIsSet(boolean value) {
    if (!value) {
      this.bkZkServersForReader = null;
    }
  }

  public String getDlZkServersForWriter() {
    return this.dlZkServersForWriter;
  }

  public BKDLConfigFormat setDlZkServersForWriter(String dlZkServersForWriter) {
    this.dlZkServersForWriter = dlZkServersForWriter;
    
    return this;
  }

  public void unsetDlZkServersForWriter() {
    this.dlZkServersForWriter = null;
  }

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

  public void setDlZkServersForWriterIsSet(boolean value) {
    if (!value) {
      this.dlZkServersForWriter = null;
    }
  }

  public String getDlZkServersForReader() {
    return this.dlZkServersForReader;
  }

  public BKDLConfigFormat setDlZkServersForReader(String dlZkServersForReader) {
    this.dlZkServersForReader = dlZkServersForReader;
    
    return this;
  }

  public void unsetDlZkServersForReader() {
    this.dlZkServersForReader = null;
  }

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

  public void setDlZkServersForReaderIsSet(boolean value) {
    if (!value) {
      this.dlZkServersForReader = null;
    }
  }

  public String getAclRootPath() {
    return this.aclRootPath;
  }

  public BKDLConfigFormat setAclRootPath(String aclRootPath) {
    this.aclRootPath = aclRootPath;
    
    return this;
  }

  public void unsetAclRootPath() {
    this.aclRootPath = null;
  }

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

  public void setAclRootPathIsSet(boolean value) {
    if (!value) {
      this.aclRootPath = null;
    }
  }

  public long getFirstLogSegmentSeqNo() {
    return this.firstLogSegmentSeqNo;
  }

  public BKDLConfigFormat setFirstLogSegmentSeqNo(long firstLogSegmentSeqNo) {
    this.firstLogSegmentSeqNo = firstLogSegmentSeqNo;
    setFirstLogSegmentSeqNoIsSet(true);

    return this;
  }

  public void unsetFirstLogSegmentSeqNo() {
  __isset_bit_vector.clear(__FIRSTLOGSEGMENTSEQNO_ISSET_ID);
  }

  /** Returns true if field firstLogSegmentSeqNo is set (has been asigned a value) and false otherwise */
  public boolean isSetFirstLogSegmentSeqNo() {
    return __isset_bit_vector.get(__FIRSTLOGSEGMENTSEQNO_ISSET_ID);
  }

  public void setFirstLogSegmentSeqNoIsSet(boolean value) {
    __isset_bit_vector.set(__FIRSTLOGSEGMENTSEQNO_ISSET_ID, value);
  }

  public boolean isFederatedNamespace() {
    return this.federatedNamespace;
  }

  public BKDLConfigFormat setFederatedNamespace(boolean federatedNamespace) {
    this.federatedNamespace = federatedNamespace;
    setFederatedNamespaceIsSet(true);

    return this;
  }

  public void unsetFederatedNamespace() {
  __isset_bit_vector.clear(__FEDERATEDNAMESPACE_ISSET_ID);
  }

  /** Returns true if field federatedNamespace is set (has been asigned a value) and false otherwise */
  public boolean isSetFederatedNamespace() {
    return __isset_bit_vector.get(__FEDERATEDNAMESPACE_ISSET_ID);
  }

  public void setFederatedNamespaceIsSet(boolean value) {
    __isset_bit_vector.set(__FEDERATEDNAMESPACE_ISSET_ID, value);
  }

  public void setFieldValue(_Fields field, Object value) {
    switch (field) {
    case BK_ZK_SERVERS:
      if (value == null) {
        unsetBkZkServers();
      } else {
        setBkZkServers((String)value);
      }
      break;
    case BK_LEDGERS_PATH:
      if (value == null) {
        unsetBkLedgersPath();
      } else {
        setBkLedgersPath((String)value);
      }
      break;
    case SANITY_CHECK_TXN_ID:
      if (value == null) {
        unsetSanityCheckTxnID();
      } else {
        setSanityCheckTxnID((Boolean)value);
      }
      break;
    case ENCODE_REGION_ID:
      if (value == null) {
        unsetEncodeRegionID();
      } else {
        setEncodeRegionID((Boolean)value);
      }
      break;
    case BK_ZK_SERVERS_FOR_READER:
      if (value == null) {
        unsetBkZkServersForReader();
      } else {
        setBkZkServersForReader((String)value);
      }
      break;
    case DL_ZK_SERVERS_FOR_WRITER:
      if (value == null) {
        unsetDlZkServersForWriter();
      } else {
        setDlZkServersForWriter((String)value);
      }
      break;
    case DL_ZK_SERVERS_FOR_READER:
      if (value == null) {
        unsetDlZkServersForReader();
      } else {
        setDlZkServersForReader((String)value);
      }
      break;
    case ACL_ROOT_PATH:
      if (value == null) {
        unsetAclRootPath();
      } else {
        setAclRootPath((String)value);
      }
      break;
    case FIRST_LOG_SEGMENT_SEQ_NO:
      if (value == null) {
        unsetFirstLogSegmentSeqNo();
      } else {
        setFirstLogSegmentSeqNo((Long)value);
      }
      break;
    case FEDERATED_NAMESPACE:
      if (value == null) {
        unsetFederatedNamespace();
      } else {
        setFederatedNamespace((Boolean)value);
      }
      break;
    }
  }

  public Object getFieldValue(_Fields field) {
    switch (field) {
    case BK_ZK_SERVERS:
      return getBkZkServers();
    case BK_LEDGERS_PATH:
      return getBkLedgersPath();
    case SANITY_CHECK_TXN_ID:
      return new Boolean(isSanityCheckTxnID());
    case ENCODE_REGION_ID:
      return new Boolean(isEncodeRegionID());
    case BK_ZK_SERVERS_FOR_READER:
      return getBkZkServersForReader();
    case DL_ZK_SERVERS_FOR_WRITER:
      return getDlZkServersForWriter();
    case DL_ZK_SERVERS_FOR_READER:
      return getDlZkServersForReader();
    case ACL_ROOT_PATH:
      return getAclRootPath();
    case FIRST_LOG_SEGMENT_SEQ_NO:
      return new Long(getFirstLogSegmentSeqNo());
    case FEDERATED_NAMESPACE:
      return new Boolean(isFederatedNamespace());
    }
    throw new IllegalStateException();
  }

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

    switch (field) {
    case BK_ZK_SERVERS:
      return isSetBkZkServers();
    case BK_LEDGERS_PATH:
      return isSetBkLedgersPath();
    case SANITY_CHECK_TXN_ID:
      return isSetSanityCheckTxnID();
    case ENCODE_REGION_ID:
      return isSetEncodeRegionID();
    case BK_ZK_SERVERS_FOR_READER:
      return isSetBkZkServersForReader();
    case DL_ZK_SERVERS_FOR_WRITER:
      return isSetDlZkServersForWriter();
    case DL_ZK_SERVERS_FOR_READER:
      return isSetDlZkServersForReader();
    case ACL_ROOT_PATH:
      return isSetAclRootPath();
    case FIRST_LOG_SEGMENT_SEQ_NO:
      return isSetFirstLogSegmentSeqNo();
    case FEDERATED_NAMESPACE:
      return isSetFederatedNamespace();
    }
    throw new IllegalStateException();
  }

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

  public boolean equals(BKDLConfigFormat that) {
    if (that == null)
      return false;
    boolean this_present_bkZkServers = true && this.isSetBkZkServers();
    boolean that_present_bkZkServers = true && that.isSetBkZkServers();
    if (this_present_bkZkServers || that_present_bkZkServers) {
      if (!(this_present_bkZkServers && that_present_bkZkServers))
        return false;
      if (!this.bkZkServers.equals(that.bkZkServers))
        return false;
    }
    boolean this_present_bkLedgersPath = true && this.isSetBkLedgersPath();
    boolean that_present_bkLedgersPath = true && that.isSetBkLedgersPath();
    if (this_present_bkLedgersPath || that_present_bkLedgersPath) {
      if (!(this_present_bkLedgersPath && that_present_bkLedgersPath))
        return false;
      if (!this.bkLedgersPath.equals(that.bkLedgersPath))
        return false;
    }
    boolean this_present_sanityCheckTxnID = true && this.isSetSanityCheckTxnID();
    boolean that_present_sanityCheckTxnID = true && that.isSetSanityCheckTxnID();
    if (this_present_sanityCheckTxnID || that_present_sanityCheckTxnID) {
      if (!(this_present_sanityCheckTxnID && that_present_sanityCheckTxnID))
        return false;
      if (this.sanityCheckTxnID != that.sanityCheckTxnID)
        return false;
    }
    boolean this_present_encodeRegionID = true && this.isSetEncodeRegionID();
    boolean that_present_encodeRegionID = true && that.isSetEncodeRegionID();
    if (this_present_encodeRegionID || that_present_encodeRegionID) {
      if (!(this_present_encodeRegionID && that_present_encodeRegionID))
        return false;
      if (this.encodeRegionID != that.encodeRegionID)
        return false;
    }
    boolean this_present_bkZkServersForReader = true && this.isSetBkZkServersForReader();
    boolean that_present_bkZkServersForReader = true && that.isSetBkZkServersForReader();
    if (this_present_bkZkServersForReader || that_present_bkZkServersForReader) {
      if (!(this_present_bkZkServersForReader && that_present_bkZkServersForReader))
        return false;
      if (!this.bkZkServersForReader.equals(that.bkZkServersForReader))
        return false;
    }
    boolean this_present_dlZkServersForWriter = true && this.isSetDlZkServersForWriter();
    boolean that_present_dlZkServersForWriter = true && that.isSetDlZkServersForWriter();
    if (this_present_dlZkServersForWriter || that_present_dlZkServersForWriter) {
      if (!(this_present_dlZkServersForWriter && that_present_dlZkServersForWriter))
        return false;
      if (!this.dlZkServersForWriter.equals(that.dlZkServersForWriter))
        return false;
    }
    boolean this_present_dlZkServersForReader = true && this.isSetDlZkServersForReader();
    boolean that_present_dlZkServersForReader = true && that.isSetDlZkServersForReader();
    if (this_present_dlZkServersForReader || that_present_dlZkServersForReader) {
      if (!(this_present_dlZkServersForReader && that_present_dlZkServersForReader))
        return false;
      if (!this.dlZkServersForReader.equals(that.dlZkServersForReader))
        return false;
    }
    boolean this_present_aclRootPath = true && this.isSetAclRootPath();
    boolean that_present_aclRootPath = true && that.isSetAclRootPath();
    if (this_present_aclRootPath || that_present_aclRootPath) {
      if (!(this_present_aclRootPath && that_present_aclRootPath))
        return false;
      if (!this.aclRootPath.equals(that.aclRootPath))
        return false;
    }
    boolean this_present_firstLogSegmentSeqNo = true && this.isSetFirstLogSegmentSeqNo();
    boolean that_present_firstLogSegmentSeqNo = true && that.isSetFirstLogSegmentSeqNo();
    if (this_present_firstLogSegmentSeqNo || that_present_firstLogSegmentSeqNo) {
      if (!(this_present_firstLogSegmentSeqNo && that_present_firstLogSegmentSeqNo))
        return false;
      if (this.firstLogSegmentSeqNo != that.firstLogSegmentSeqNo)
        return false;
    }
    boolean this_present_federatedNamespace = true && this.isSetFederatedNamespace();
    boolean that_present_federatedNamespace = true && that.isSetFederatedNamespace();
    if (this_present_federatedNamespace || that_present_federatedNamespace) {
      if (!(this_present_federatedNamespace && that_present_federatedNamespace))
        return false;
      if (this.federatedNamespace != that.federatedNamespace)
        return false;
    }

    return true;
  }

  @Override
  public int hashCode() {
    HashCodeBuilder builder = new HashCodeBuilder();
    boolean present_bkZkServers = true && (isSetBkZkServers());
    builder.append(present_bkZkServers);
    if (present_bkZkServers)
      builder.append(bkZkServers);
    boolean present_bkLedgersPath = true && (isSetBkLedgersPath());
    builder.append(present_bkLedgersPath);
    if (present_bkLedgersPath)
      builder.append(bkLedgersPath);
    boolean present_sanityCheckTxnID = true && (isSetSanityCheckTxnID());
    builder.append(present_sanityCheckTxnID);
    if (present_sanityCheckTxnID)
      builder.append(sanityCheckTxnID);
    boolean present_encodeRegionID = true && (isSetEncodeRegionID());
    builder.append(present_encodeRegionID);
    if (present_encodeRegionID)
      builder.append(encodeRegionID);
    boolean present_bkZkServersForReader = true && (isSetBkZkServersForReader());
    builder.append(present_bkZkServersForReader);
    if (present_bkZkServersForReader)
      builder.append(bkZkServersForReader);
    boolean present_dlZkServersForWriter = true && (isSetDlZkServersForWriter());
    builder.append(present_dlZkServersForWriter);
    if (present_dlZkServersForWriter)
      builder.append(dlZkServersForWriter);
    boolean present_dlZkServersForReader = true && (isSetDlZkServersForReader());
    builder.append(present_dlZkServersForReader);
    if (present_dlZkServersForReader)
      builder.append(dlZkServersForReader);
    boolean present_aclRootPath = true && (isSetAclRootPath());
    builder.append(present_aclRootPath);
    if (present_aclRootPath)
      builder.append(aclRootPath);
    boolean present_firstLogSegmentSeqNo = true && (isSetFirstLogSegmentSeqNo());
    builder.append(present_firstLogSegmentSeqNo);
    if (present_firstLogSegmentSeqNo)
      builder.append(firstLogSegmentSeqNo);
    boolean present_federatedNamespace = true && (isSetFederatedNamespace());
    builder.append(present_federatedNamespace);
    if (present_federatedNamespace)
      builder.append(federatedNamespace);
    return builder.toHashCode();
  }

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

    int lastComparison = 0;
    BKDLConfigFormat typedOther = (BKDLConfigFormat)other;

    lastComparison = Boolean.valueOf(isSetBkZkServers()).compareTo(typedOther.isSetBkZkServers());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetBkZkServers()) {
      lastComparison = TBaseHelper.compareTo(this.bkZkServers, typedOther.bkZkServers);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetBkLedgersPath()).compareTo(typedOther.isSetBkLedgersPath());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetBkLedgersPath()) {
      lastComparison = TBaseHelper.compareTo(this.bkLedgersPath, typedOther.bkLedgersPath);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetSanityCheckTxnID()).compareTo(typedOther.isSetSanityCheckTxnID());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetSanityCheckTxnID()) {
      lastComparison = TBaseHelper.compareTo(this.sanityCheckTxnID, typedOther.sanityCheckTxnID);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetEncodeRegionID()).compareTo(typedOther.isSetEncodeRegionID());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetEncodeRegionID()) {
      lastComparison = TBaseHelper.compareTo(this.encodeRegionID, typedOther.encodeRegionID);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetBkZkServersForReader()).compareTo(typedOther.isSetBkZkServersForReader());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetBkZkServersForReader()) {
      lastComparison = TBaseHelper.compareTo(this.bkZkServersForReader, typedOther.bkZkServersForReader);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetDlZkServersForWriter()).compareTo(typedOther.isSetDlZkServersForWriter());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetDlZkServersForWriter()) {
      lastComparison = TBaseHelper.compareTo(this.dlZkServersForWriter, typedOther.dlZkServersForWriter);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetDlZkServersForReader()).compareTo(typedOther.isSetDlZkServersForReader());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetDlZkServersForReader()) {
      lastComparison = TBaseHelper.compareTo(this.dlZkServersForReader, typedOther.dlZkServersForReader);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetAclRootPath()).compareTo(typedOther.isSetAclRootPath());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetAclRootPath()) {
      lastComparison = TBaseHelper.compareTo(this.aclRootPath, typedOther.aclRootPath);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetFirstLogSegmentSeqNo()).compareTo(typedOther.isSetFirstLogSegmentSeqNo());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetFirstLogSegmentSeqNo()) {
      lastComparison = TBaseHelper.compareTo(this.firstLogSegmentSeqNo, typedOther.firstLogSegmentSeqNo);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetFederatedNamespace()).compareTo(typedOther.isSetFederatedNamespace());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetFederatedNamespace()) {
      lastComparison = TBaseHelper.compareTo(this.federatedNamespace, typedOther.federatedNamespace);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }

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


  public void read(TProtocol iprot) throws TException {
    TField field;
    iprot.readStructBegin();
    while (true)
    {
      field = iprot.readFieldBegin();
      if (field.type == TType.STOP) {
        break;
      }
      switch (field.id) {
        case 1: // BK_ZK_SERVERS
          if (field.type == TType.STRING) {
            this.bkZkServers = iprot.readString();
          } else {
            TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 2: // BK_LEDGERS_PATH
          if (field.type == TType.STRING) {
            this.bkLedgersPath = iprot.readString();
          } else {
            TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 3: // SANITY_CHECK_TXN_ID
          if (field.type == TType.BOOL) {
            this.sanityCheckTxnID = iprot.readBool();
            setSanityCheckTxnIDIsSet(true);
          } else {
            TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 4: // ENCODE_REGION_ID
          if (field.type == TType.BOOL) {
            this.encodeRegionID = iprot.readBool();
            setEncodeRegionIDIsSet(true);
          } else {
            TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 5: // BK_ZK_SERVERS_FOR_READER
          if (field.type == TType.STRING) {
            this.bkZkServersForReader = iprot.readString();
          } else {
            TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 6: // DL_ZK_SERVERS_FOR_WRITER
          if (field.type == TType.STRING) {
            this.dlZkServersForWriter = iprot.readString();
          } else {
            TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 7: // DL_ZK_SERVERS_FOR_READER
          if (field.type == TType.STRING) {
            this.dlZkServersForReader = iprot.readString();
          } else {
            TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 8: // ACL_ROOT_PATH
          if (field.type == TType.STRING) {
            this.aclRootPath = iprot.readString();
          } else {
            TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 9: // FIRST_LOG_SEGMENT_SEQ_NO
          if (field.type == TType.I64) {
            this.firstLogSegmentSeqNo = iprot.readI64();
            setFirstLogSegmentSeqNoIsSet(true);
          } else {
            TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 10: // FEDERATED_NAMESPACE
          if (field.type == TType.BOOL) {
            this.federatedNamespace = iprot.readBool();
            setFederatedNamespaceIsSet(true);
          } else {
            TProtocolUtil.skip(iprot, field.type);
          }
          break;
        default:
          TProtocolUtil.skip(iprot, field.type);
      }
      iprot.readFieldEnd();
    }
    iprot.readStructEnd();

    // check for required fields of primitive type, which can't be checked in the validate method
    validate();
  }

  public void write(TProtocol oprot) throws TException {
    validate();
    
    oprot.writeStructBegin(STRUCT_DESC);
    if (this.bkZkServers != null) {
      if (isSetBkZkServers()) {
        oprot.writeFieldBegin(BK_ZK_SERVERS_FIELD_DESC);
        oprot.writeString(this.bkZkServers);
        oprot.writeFieldEnd();
      }
    }
    if (this.bkLedgersPath != null) {
      if (isSetBkLedgersPath()) {
        oprot.writeFieldBegin(BK_LEDGERS_PATH_FIELD_DESC);
        oprot.writeString(this.bkLedgersPath);
        oprot.writeFieldEnd();
      }
    }
    if (isSetSanityCheckTxnID()) {
      oprot.writeFieldBegin(SANITY_CHECK_TXN_ID_FIELD_DESC);
      oprot.writeBool(this.sanityCheckTxnID);
      oprot.writeFieldEnd();
    }
    if (isSetEncodeRegionID()) {
      oprot.writeFieldBegin(ENCODE_REGION_ID_FIELD_DESC);
      oprot.writeBool(this.encodeRegionID);
      oprot.writeFieldEnd();
    }
    if (this.bkZkServersForReader != null) {
      if (isSetBkZkServersForReader()) {
        oprot.writeFieldBegin(BK_ZK_SERVERS_FOR_READER_FIELD_DESC);
        oprot.writeString(this.bkZkServersForReader);
        oprot.writeFieldEnd();
      }
    }
    if (this.dlZkServersForWriter != null) {
      if (isSetDlZkServersForWriter()) {
        oprot.writeFieldBegin(DL_ZK_SERVERS_FOR_WRITER_FIELD_DESC);
        oprot.writeString(this.dlZkServersForWriter);
        oprot.writeFieldEnd();
      }
    }
    if (this.dlZkServersForReader != null) {
      if (isSetDlZkServersForReader()) {
        oprot.writeFieldBegin(DL_ZK_SERVERS_FOR_READER_FIELD_DESC);
        oprot.writeString(this.dlZkServersForReader);
        oprot.writeFieldEnd();
      }
    }
    if (this.aclRootPath != null) {
      if (isSetAclRootPath()) {
        oprot.writeFieldBegin(ACL_ROOT_PATH_FIELD_DESC);
        oprot.writeString(this.aclRootPath);
        oprot.writeFieldEnd();
      }
    }
    if (isSetFirstLogSegmentSeqNo()) {
      oprot.writeFieldBegin(FIRST_LOG_SEGMENT_SEQ_NO_FIELD_DESC);
      oprot.writeI64(this.firstLogSegmentSeqNo);
      oprot.writeFieldEnd();
    }
    if (isSetFederatedNamespace()) {
      oprot.writeFieldBegin(FEDERATED_NAMESPACE_FIELD_DESC);
      oprot.writeBool(this.federatedNamespace);
      oprot.writeFieldEnd();
    }
    oprot.writeFieldStop();
    oprot.writeStructEnd();
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder("BKDLConfigFormat(");
    boolean first = true;
    if (isSetBkZkServers()) {
      sb.append("bkZkServers:");
      if (this.bkZkServers == null) {
        sb.append("null");
      } else {
        sb.append(this.bkZkServers);
      }
      first = false;
      }
    if (isSetBkLedgersPath()) {
      if (!first) sb.append(", ");
      sb.append("bkLedgersPath:");
      if (this.bkLedgersPath == null) {
        sb.append("null");
      } else {
        sb.append(this.bkLedgersPath);
      }
      first = false;
      }
    if (isSetSanityCheckTxnID()) {
      if (!first) sb.append(", ");
      sb.append("sanityCheckTxnID:");
      sb.append(this.sanityCheckTxnID);
      first = false;
      }
    if (isSetEncodeRegionID()) {
      if (!first) sb.append(", ");
      sb.append("encodeRegionID:");
      sb.append(this.encodeRegionID);
      first = false;
      }
    if (isSetBkZkServersForReader()) {
      if (!first) sb.append(", ");
      sb.append("bkZkServersForReader:");
      if (this.bkZkServersForReader == null) {
        sb.append("null");
      } else {
        sb.append(this.bkZkServersForReader);
      }
      first = false;
      }
    if (isSetDlZkServersForWriter()) {
      if (!first) sb.append(", ");
      sb.append("dlZkServersForWriter:");
      if (this.dlZkServersForWriter == null) {
        sb.append("null");
      } else {
        sb.append(this.dlZkServersForWriter);
      }
      first = false;
      }
    if (isSetDlZkServersForReader()) {
      if (!first) sb.append(", ");
      sb.append("dlZkServersForReader:");
      if (this.dlZkServersForReader == null) {
        sb.append("null");
      } else {
        sb.append(this.dlZkServersForReader);
      }
      first = false;
      }
    if (isSetAclRootPath()) {
      if (!first) sb.append(", ");
      sb.append("aclRootPath:");
      if (this.aclRootPath == null) {
        sb.append("null");
      } else {
        sb.append(this.aclRootPath);
      }
      first = false;
      }
    if (isSetFirstLogSegmentSeqNo()) {
      if (!first) sb.append(", ");
      sb.append("firstLogSegmentSeqNo:");
      sb.append(this.firstLogSegmentSeqNo);
      first = false;
      }
    if (isSetFederatedNamespace()) {
      if (!first) sb.append(", ");
      sb.append("federatedNamespace:");
      sb.append(this.federatedNamespace);
      first = false;
      }
    sb.append(")");
    return sb.toString();
  }

  public void validate() throws TException {
    // check for required fields
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy