/** * Autogenerated by Thrift Compiler (0.9.2) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package com.splout.db.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 javax.annotation.Generated; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) @Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2014-12-8") public class PartitionMetadata implements org.apache.thrift.TBase<PartitionMetadata, PartitionMetadata._Fields>, java.io.Serializable, Cloneable, Comparable<PartitionMetadata> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("PartitionMetadata"); private static final org.apache.thrift.protocol.TField MIN_KEY_FIELD_DESC = new org.apache.thrift.protocol.TField("minKey", org.apache.thrift.protocol.TType.STRING, (short)1); private static final org.apache.thrift.protocol.TField MAX_KEY_FIELD_DESC = new org.apache.thrift.protocol.TField("maxKey", org.apache.thrift.protocol.TType.STRING, (short)2); private static final org.apache.thrift.protocol.TField N_REPLICAS_FIELD_DESC = new org.apache.thrift.protocol.TField("nReplicas", org.apache.thrift.protocol.TType.I32, (short)3); private static final org.apache.thrift.protocol.TField DEPLOYMENT_DATE_FIELD_DESC = new org.apache.thrift.protocol.TField("deploymentDate", org.apache.thrift.protocol.TType.I64, (short)4); private static final org.apache.thrift.protocol.TField INIT_STATEMENTS_FIELD_DESC = new org.apache.thrift.protocol.TField("initStatements", org.apache.thrift.protocol.TType.LIST, (short)5); private static final org.apache.thrift.protocol.TField ENGINE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("engineId", org.apache.thrift.protocol.TType.STRING, (short)6); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new PartitionMetadataStandardSchemeFactory()); schemes.put(TupleScheme.class, new PartitionMetadataTupleSchemeFactory()); } public String minKey; // required public String maxKey; // required public int nReplicas; // required public long deploymentDate; // required public List<String> initStatements; // optional public String engineId; // optional /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { MIN_KEY((short)1, "minKey"), MAX_KEY((short)2, "maxKey"), N_REPLICAS((short)3, "nReplicas"), DEPLOYMENT_DATE((short)4, "deploymentDate"), INIT_STATEMENTS((short)5, "initStatements"), ENGINE_ID((short)6, "engineId"); 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: // MIN_KEY return MIN_KEY; case 2: // MAX_KEY return MAX_KEY; case 3: // N_REPLICAS return N_REPLICAS; case 4: // DEPLOYMENT_DATE return DEPLOYMENT_DATE; case 5: // INIT_STATEMENTS return INIT_STATEMENTS; case 6: // ENGINE_ID return ENGINE_ID; 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 __NREPLICAS_ISSET_ID = 0; private static final int __DEPLOYMENTDATE_ISSET_ID = 1; private byte __isset_bitfield = 0; private static final _Fields optionals[] = {_Fields.INIT_STATEMENTS,_Fields.ENGINE_ID}; 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.MIN_KEY, new org.apache.thrift.meta_data.FieldMetaData("minKey", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.MAX_KEY, new org.apache.thrift.meta_data.FieldMetaData("maxKey", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.N_REPLICAS, new org.apache.thrift.meta_data.FieldMetaData("nReplicas", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); tmpMap.put(_Fields.DEPLOYMENT_DATE, new org.apache.thrift.meta_data.FieldMetaData("deploymentDate", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.INIT_STATEMENTS, new org.apache.thrift.meta_data.FieldMetaData("initStatements", org.apache.thrift.TFieldRequirementType.OPTIONAL, 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.STRING)))); tmpMap.put(_Fields.ENGINE_ID, new org.apache.thrift.meta_data.FieldMetaData("engineId", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(PartitionMetadata.class, metaDataMap); } public PartitionMetadata() { } public PartitionMetadata( String minKey, String maxKey, int nReplicas, long deploymentDate) { this(); this.minKey = minKey; this.maxKey = maxKey; this.nReplicas = nReplicas; setNReplicasIsSet(true); this.deploymentDate = deploymentDate; setDeploymentDateIsSet(true); } /** * Performs a deep copy on <i>other</i>. */ public PartitionMetadata(PartitionMetadata other) { __isset_bitfield = other.__isset_bitfield; if (other.isSetMinKey()) { this.minKey = other.minKey; } if (other.isSetMaxKey()) { this.maxKey = other.maxKey; } this.nReplicas = other.nReplicas; this.deploymentDate = other.deploymentDate; if (other.isSetInitStatements()) { List<String> __this__initStatements = new ArrayList<String>(other.initStatements); this.initStatements = __this__initStatements; } if (other.isSetEngineId()) { this.engineId = other.engineId; } } public PartitionMetadata deepCopy() { return new PartitionMetadata(this); } @Override public void clear() { this.minKey = null; this.maxKey = null; setNReplicasIsSet(false); this.nReplicas = 0; setDeploymentDateIsSet(false); this.deploymentDate = 0; this.initStatements = null; this.engineId = null; } public String getMinKey() { return this.minKey; } public PartitionMetadata setMinKey(String minKey) { this.minKey = minKey; return this; } public void unsetMinKey() { this.minKey = null; } /** Returns true if field minKey is set (has been assigned a value) and false otherwise */ public boolean isSetMinKey() { return this.minKey != null; } public void setMinKeyIsSet(boolean value) { if (!value) { this.minKey = null; } } public String getMaxKey() { return this.maxKey; } public PartitionMetadata setMaxKey(String maxKey) { this.maxKey = maxKey; return this; } public void unsetMaxKey() { this.maxKey = null; } /** Returns true if field maxKey is set (has been assigned a value) and false otherwise */ public boolean isSetMaxKey() { return this.maxKey != null; } public void setMaxKeyIsSet(boolean value) { if (!value) { this.maxKey = null; } } public int getNReplicas() { return this.nReplicas; } public PartitionMetadata setNReplicas(int nReplicas) { this.nReplicas = nReplicas; setNReplicasIsSet(true); return this; } public void unsetNReplicas() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __NREPLICAS_ISSET_ID); } /** Returns true if field nReplicas is set (has been assigned a value) and false otherwise */ public boolean isSetNReplicas() { return EncodingUtils.testBit(__isset_bitfield, __NREPLICAS_ISSET_ID); } public void setNReplicasIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __NREPLICAS_ISSET_ID, value); } public long getDeploymentDate() { return this.deploymentDate; } public PartitionMetadata setDeploymentDate(long deploymentDate) { this.deploymentDate = deploymentDate; setDeploymentDateIsSet(true); return this; } public void unsetDeploymentDate() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __DEPLOYMENTDATE_ISSET_ID); } /** Returns true if field deploymentDate is set (has been assigned a value) and false otherwise */ public boolean isSetDeploymentDate() { return EncodingUtils.testBit(__isset_bitfield, __DEPLOYMENTDATE_ISSET_ID); } public void setDeploymentDateIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __DEPLOYMENTDATE_ISSET_ID, value); } public int getInitStatementsSize() { return (this.initStatements == null) ? 0 : this.initStatements.size(); } public java.util.Iterator<String> getInitStatementsIterator() { return (this.initStatements == null) ? null : this.initStatements.iterator(); } public void addToInitStatements(String elem) { if (this.initStatements == null) { this.initStatements = new ArrayList<String>(); } this.initStatements.add(elem); } public List<String> getInitStatements() { return this.initStatements; } public PartitionMetadata setInitStatements(List<String> initStatements) { this.initStatements = initStatements; return this; } public void unsetInitStatements() { this.initStatements = null; } /** Returns true if field initStatements is set (has been assigned a value) and false otherwise */ public boolean isSetInitStatements() { return this.initStatements != null; } public void setInitStatementsIsSet(boolean value) { if (!value) { this.initStatements = null; } } public String getEngineId() { return this.engineId; } public PartitionMetadata setEngineId(String engineId) { this.engineId = engineId; return this; } public void unsetEngineId() { this.engineId = null; } /** Returns true if field engineId is set (has been assigned a value) and false otherwise */ public boolean isSetEngineId() { return this.engineId != null; } public void setEngineIdIsSet(boolean value) { if (!value) { this.engineId = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case MIN_KEY: if (value == null) { unsetMinKey(); } else { setMinKey((String)value); } break; case MAX_KEY: if (value == null) { unsetMaxKey(); } else { setMaxKey((String)value); } break; case N_REPLICAS: if (value == null) { unsetNReplicas(); } else { setNReplicas((Integer)value); } break; case DEPLOYMENT_DATE: if (value == null) { unsetDeploymentDate(); } else { setDeploymentDate((Long)value); } break; case INIT_STATEMENTS: if (value == null) { unsetInitStatements(); } else { setInitStatements((List<String>)value); } break; case ENGINE_ID: if (value == null) { unsetEngineId(); } else { setEngineId((String)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case MIN_KEY: return getMinKey(); case MAX_KEY: return getMaxKey(); case N_REPLICAS: return Integer.valueOf(getNReplicas()); case DEPLOYMENT_DATE: return Long.valueOf(getDeploymentDate()); case INIT_STATEMENTS: return getInitStatements(); case ENGINE_ID: return getEngineId(); } 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 MIN_KEY: return isSetMinKey(); case MAX_KEY: return isSetMaxKey(); case N_REPLICAS: return isSetNReplicas(); case DEPLOYMENT_DATE: return isSetDeploymentDate(); case INIT_STATEMENTS: return isSetInitStatements(); case ENGINE_ID: return isSetEngineId(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof PartitionMetadata) return this.equals((PartitionMetadata)that); return false; } public boolean equals(PartitionMetadata that) { if (that == null) return false; boolean this_present_minKey = true && this.isSetMinKey(); boolean that_present_minKey = true && that.isSetMinKey(); if (this_present_minKey || that_present_minKey) { if (!(this_present_minKey && that_present_minKey)) return false; if (!this.minKey.equals(that.minKey)) return false; } boolean this_present_maxKey = true && this.isSetMaxKey(); boolean that_present_maxKey = true && that.isSetMaxKey(); if (this_present_maxKey || that_present_maxKey) { if (!(this_present_maxKey && that_present_maxKey)) return false; if (!this.maxKey.equals(that.maxKey)) return false; } boolean this_present_nReplicas = true; boolean that_present_nReplicas = true; if (this_present_nReplicas || that_present_nReplicas) { if (!(this_present_nReplicas && that_present_nReplicas)) return false; if (this.nReplicas != that.nReplicas) return false; } boolean this_present_deploymentDate = true; boolean that_present_deploymentDate = true; if (this_present_deploymentDate || that_present_deploymentDate) { if (!(this_present_deploymentDate && that_present_deploymentDate)) return false; if (this.deploymentDate != that.deploymentDate) return false; } boolean this_present_initStatements = true && this.isSetInitStatements(); boolean that_present_initStatements = true && that.isSetInitStatements(); if (this_present_initStatements || that_present_initStatements) { if (!(this_present_initStatements && that_present_initStatements)) return false; if (!this.initStatements.equals(that.initStatements)) return false; } boolean this_present_engineId = true && this.isSetEngineId(); boolean that_present_engineId = true && that.isSetEngineId(); if (this_present_engineId || that_present_engineId) { if (!(this_present_engineId && that_present_engineId)) return false; if (!this.engineId.equals(that.engineId)) return false; } return true; } @Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_minKey = true && (isSetMinKey()); list.add(present_minKey); if (present_minKey) list.add(minKey); boolean present_maxKey = true && (isSetMaxKey()); list.add(present_maxKey); if (present_maxKey) list.add(maxKey); boolean present_nReplicas = true; list.add(present_nReplicas); if (present_nReplicas) list.add(nReplicas); boolean present_deploymentDate = true; list.add(present_deploymentDate); if (present_deploymentDate) list.add(deploymentDate); boolean present_initStatements = true && (isSetInitStatements()); list.add(present_initStatements); if (present_initStatements) list.add(initStatements); boolean present_engineId = true && (isSetEngineId()); list.add(present_engineId); if (present_engineId) list.add(engineId); return list.hashCode(); } @Override public int compareTo(PartitionMetadata other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetMinKey()).compareTo(other.isSetMinKey()); if (lastComparison != 0) { return lastComparison; } if (isSetMinKey()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.minKey, other.minKey); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetMaxKey()).compareTo(other.isSetMaxKey()); if (lastComparison != 0) { return lastComparison; } if (isSetMaxKey()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.maxKey, other.maxKey); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetNReplicas()).compareTo(other.isSetNReplicas()); if (lastComparison != 0) { return lastComparison; } if (isSetNReplicas()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.nReplicas, other.nReplicas); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetDeploymentDate()).compareTo(other.isSetDeploymentDate()); if (lastComparison != 0) { return lastComparison; } if (isSetDeploymentDate()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.deploymentDate, other.deploymentDate); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetInitStatements()).compareTo(other.isSetInitStatements()); if (lastComparison != 0) { return lastComparison; } if (isSetInitStatements()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.initStatements, other.initStatements); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetEngineId()).compareTo(other.isSetEngineId()); if (lastComparison != 0) { return lastComparison; } if (isSetEngineId()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.engineId, other.engineId); 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("PartitionMetadata("); boolean first = true; sb.append("minKey:"); if (this.minKey == null) { sb.append("null"); } else { sb.append(this.minKey); } first = false; if (!first) sb.append(", "); sb.append("maxKey:"); if (this.maxKey == null) { sb.append("null"); } else { sb.append(this.maxKey); } first = false; if (!first) sb.append(", "); sb.append("nReplicas:"); sb.append(this.nReplicas); first = false; if (!first) sb.append(", "); sb.append("deploymentDate:"); sb.append(this.deploymentDate); first = false; if (isSetInitStatements()) { if (!first) sb.append(", "); sb.append("initStatements:"); if (this.initStatements == null) { sb.append("null"); } else { sb.append(this.initStatements); } first = false; } if (isSetEngineId()) { if (!first) sb.append(", "); sb.append("engineId:"); if (this.engineId == null) { sb.append("null"); } else { sb.append(this.engineId); } 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 { // 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 PartitionMetadataStandardSchemeFactory implements SchemeFactory { public PartitionMetadataStandardScheme getScheme() { return new PartitionMetadataStandardScheme(); } } private static class PartitionMetadataStandardScheme extends StandardScheme<PartitionMetadata> { public void read(org.apache.thrift.protocol.TProtocol iprot, PartitionMetadata 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: // MIN_KEY if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.minKey = iprot.readString(); struct.setMinKeyIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // MAX_KEY if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.maxKey = iprot.readString(); struct.setMaxKeyIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 3: // N_REPLICAS if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.nReplicas = iprot.readI32(); struct.setNReplicasIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 4: // DEPLOYMENT_DATE if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.deploymentDate = iprot.readI64(); struct.setDeploymentDateIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 5: // INIT_STATEMENTS if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list0 = iprot.readListBegin(); struct.initStatements = new ArrayList<String>(_list0.size); String _elem1; for (int _i2 = 0; _i2 < _list0.size; ++_i2) { _elem1 = iprot.readString(); struct.initStatements.add(_elem1); } iprot.readListEnd(); } struct.setInitStatementsIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 6: // ENGINE_ID if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.engineId = iprot.readString(); struct.setEngineIdIsSet(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, PartitionMetadata struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.minKey != null) { oprot.writeFieldBegin(MIN_KEY_FIELD_DESC); oprot.writeString(struct.minKey); oprot.writeFieldEnd(); } if (struct.maxKey != null) { oprot.writeFieldBegin(MAX_KEY_FIELD_DESC); oprot.writeString(struct.maxKey); oprot.writeFieldEnd(); } oprot.writeFieldBegin(N_REPLICAS_FIELD_DESC); oprot.writeI32(struct.nReplicas); oprot.writeFieldEnd(); oprot.writeFieldBegin(DEPLOYMENT_DATE_FIELD_DESC); oprot.writeI64(struct.deploymentDate); oprot.writeFieldEnd(); if (struct.initStatements != null) { if (struct.isSetInitStatements()) { oprot.writeFieldBegin(INIT_STATEMENTS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.initStatements.size())); for (String _iter3 : struct.initStatements) { oprot.writeString(_iter3); } oprot.writeListEnd(); } oprot.writeFieldEnd(); } } if (struct.engineId != null) { if (struct.isSetEngineId()) { oprot.writeFieldBegin(ENGINE_ID_FIELD_DESC); oprot.writeString(struct.engineId); oprot.writeFieldEnd(); } } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class PartitionMetadataTupleSchemeFactory implements SchemeFactory { public PartitionMetadataTupleScheme getScheme() { return new PartitionMetadataTupleScheme(); } } private static class PartitionMetadataTupleScheme extends TupleScheme<PartitionMetadata> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, PartitionMetadata struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetMinKey()) { optionals.set(0); } if (struct.isSetMaxKey()) { optionals.set(1); } if (struct.isSetNReplicas()) { optionals.set(2); } if (struct.isSetDeploymentDate()) { optionals.set(3); } if (struct.isSetInitStatements()) { optionals.set(4); } if (struct.isSetEngineId()) { optionals.set(5); } oprot.writeBitSet(optionals, 6); if (struct.isSetMinKey()) { oprot.writeString(struct.minKey); } if (struct.isSetMaxKey()) { oprot.writeString(struct.maxKey); } if (struct.isSetNReplicas()) { oprot.writeI32(struct.nReplicas); } if (struct.isSetDeploymentDate()) { oprot.writeI64(struct.deploymentDate); } if (struct.isSetInitStatements()) { { oprot.writeI32(struct.initStatements.size()); for (String _iter4 : struct.initStatements) { oprot.writeString(_iter4); } } } if (struct.isSetEngineId()) { oprot.writeString(struct.engineId); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, PartitionMetadata struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(6); if (incoming.get(0)) { struct.minKey = iprot.readString(); struct.setMinKeyIsSet(true); } if (incoming.get(1)) { struct.maxKey = iprot.readString(); struct.setMaxKeyIsSet(true); } if (incoming.get(2)) { struct.nReplicas = iprot.readI32(); struct.setNReplicasIsSet(true); } if (incoming.get(3)) { struct.deploymentDate = iprot.readI64(); struct.setDeploymentDateIsSet(true); } if (incoming.get(4)) { { org.apache.thrift.protocol.TList _list5 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); struct.initStatements = new ArrayList<String>(_list5.size); String _elem6; for (int _i7 = 0; _i7 < _list5.size; ++_i7) { _elem6 = iprot.readString(); struct.initStatements.add(_elem6); } } struct.setInitStatementsIsSet(true); } if (incoming.get(5)) { struct.engineId = iprot.readString(); struct.setEngineIdIsSet(true); } } } }