/**
* Autogenerated by Thrift Compiler (0.7.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
*/
package org.apache.hadoop.corona;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.util.HashMap;
import java.util.EnumMap;
import java.util.Set;
import java.util.HashSet;
import java.util.EnumSet;
import java.util.Collections;
import java.util.BitSet;
import java.nio.ByteBuffer;
import java.util.Arrays;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class ActualPoolInfoArgs implements org.apache.thrift.TBase<ActualPoolInfoArgs, ActualPoolInfoArgs._Fields>, java.io.Serializable, Cloneable {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ActualPoolInfoArgs");
private static final org.apache.thrift.protocol.TField POOL_INFO_STRING_FIELD_DESC = new org.apache.thrift.protocol.TField("poolInfoString", org.apache.thrift.protocol.TType.STRUCT, (short)1);
private static final org.apache.thrift.protocol.TField JOB_INPUT_SIZE_FIELD_DESC = new org.apache.thrift.protocol.TField("jobInputSize", org.apache.thrift.protocol.TType.I64, (short)2);
public PoolInfoStrings poolInfoString; // required
public long jobInputSize; // 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 {
POOL_INFO_STRING((short)1, "poolInfoString"),
JOB_INPUT_SIZE((short)2, "jobInputSize");
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: // POOL_INFO_STRING
return POOL_INFO_STRING;
case 2: // JOB_INPUT_SIZE
return JOB_INPUT_SIZE;
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 __JOBINPUTSIZE_ISSET_ID = 0;
private BitSet __isset_bit_vector = new BitSet(1);
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.POOL_INFO_STRING, new org.apache.thrift.meta_data.FieldMetaData("poolInfoString", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, PoolInfoStrings.class)));
tmpMap.put(_Fields.JOB_INPUT_SIZE, new org.apache.thrift.meta_data.FieldMetaData("jobInputSize", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ActualPoolInfoArgs.class, metaDataMap);
}
public ActualPoolInfoArgs() {
}
public ActualPoolInfoArgs(
PoolInfoStrings poolInfoString,
long jobInputSize)
{
this();
this.poolInfoString = poolInfoString;
this.jobInputSize = jobInputSize;
setJobInputSizeIsSet(true);
}
/**
* Performs a deep copy on <i>other</i>.
*/
public ActualPoolInfoArgs(ActualPoolInfoArgs other) {
__isset_bit_vector.clear();
__isset_bit_vector.or(other.__isset_bit_vector);
if (other.isSetPoolInfoString()) {
this.poolInfoString = new PoolInfoStrings(other.poolInfoString);
}
this.jobInputSize = other.jobInputSize;
}
public ActualPoolInfoArgs deepCopy() {
return new ActualPoolInfoArgs(this);
}
@Override
public void clear() {
this.poolInfoString = null;
setJobInputSizeIsSet(false);
this.jobInputSize = 0;
}
public PoolInfoStrings getPoolInfoString() {
return this.poolInfoString;
}
public ActualPoolInfoArgs setPoolInfoString(PoolInfoStrings poolInfoString) {
this.poolInfoString = poolInfoString;
return this;
}
public void unsetPoolInfoString() {
this.poolInfoString = null;
}
/** Returns true if field poolInfoString is set (has been assigned a value) and false otherwise */
public boolean isSetPoolInfoString() {
return this.poolInfoString != null;
}
public void setPoolInfoStringIsSet(boolean value) {
if (!value) {
this.poolInfoString = null;
}
}
public long getJobInputSize() {
return this.jobInputSize;
}
public ActualPoolInfoArgs setJobInputSize(long jobInputSize) {
this.jobInputSize = jobInputSize;
setJobInputSizeIsSet(true);
return this;
}
public void unsetJobInputSize() {
__isset_bit_vector.clear(__JOBINPUTSIZE_ISSET_ID);
}
/** Returns true if field jobInputSize is set (has been assigned a value) and false otherwise */
public boolean isSetJobInputSize() {
return __isset_bit_vector.get(__JOBINPUTSIZE_ISSET_ID);
}
public void setJobInputSizeIsSet(boolean value) {
__isset_bit_vector.set(__JOBINPUTSIZE_ISSET_ID, value);
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case POOL_INFO_STRING:
if (value == null) {
unsetPoolInfoString();
} else {
setPoolInfoString((PoolInfoStrings)value);
}
break;
case JOB_INPUT_SIZE:
if (value == null) {
unsetJobInputSize();
} else {
setJobInputSize((Long)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case POOL_INFO_STRING:
return getPoolInfoString();
case JOB_INPUT_SIZE:
return Long.valueOf(getJobInputSize());
}
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 POOL_INFO_STRING:
return isSetPoolInfoString();
case JOB_INPUT_SIZE:
return isSetJobInputSize();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof ActualPoolInfoArgs)
return this.equals((ActualPoolInfoArgs)that);
return false;
}
public boolean equals(ActualPoolInfoArgs that) {
if (that == null)
return false;
boolean this_present_poolInfoString = true && this.isSetPoolInfoString();
boolean that_present_poolInfoString = true && that.isSetPoolInfoString();
if (this_present_poolInfoString || that_present_poolInfoString) {
if (!(this_present_poolInfoString && that_present_poolInfoString))
return false;
if (!this.poolInfoString.equals(that.poolInfoString))
return false;
}
boolean this_present_jobInputSize = true;
boolean that_present_jobInputSize = true;
if (this_present_jobInputSize || that_present_jobInputSize) {
if (!(this_present_jobInputSize && that_present_jobInputSize))
return false;
if (this.jobInputSize != that.jobInputSize)
return false;
}
return true;
}
@Override
public int hashCode() {
return 0;
}
public int compareTo(ActualPoolInfoArgs other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
ActualPoolInfoArgs typedOther = (ActualPoolInfoArgs)other;
lastComparison = Boolean.valueOf(isSetPoolInfoString()).compareTo(typedOther.isSetPoolInfoString());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetPoolInfoString()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.poolInfoString, typedOther.poolInfoString);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetJobInputSize()).compareTo(typedOther.isSetJobInputSize());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetJobInputSize()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.jobInputSize, typedOther.jobInputSize);
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 {
org.apache.thrift.protocol.TField field;
iprot.readStructBegin();
while (true)
{
field = iprot.readFieldBegin();
if (field.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (field.id) {
case 1: // POOL_INFO_STRING
if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
this.poolInfoString = new PoolInfoStrings();
this.poolInfoString.read(iprot);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
}
break;
case 2: // JOB_INPUT_SIZE
if (field.type == org.apache.thrift.protocol.TType.I64) {
this.jobInputSize = iprot.readI64();
setJobInputSizeIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
}
break;
default:
org.apache.thrift.protocol.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
if (!isSetJobInputSize()) {
throw new org.apache.thrift.protocol.TProtocolException("Required field 'jobInputSize' was not found in serialized data! Struct: " + toString());
}
validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
validate();
oprot.writeStructBegin(STRUCT_DESC);
if (this.poolInfoString != null) {
oprot.writeFieldBegin(POOL_INFO_STRING_FIELD_DESC);
this.poolInfoString.write(oprot);
oprot.writeFieldEnd();
}
oprot.writeFieldBegin(JOB_INPUT_SIZE_FIELD_DESC);
oprot.writeI64(this.jobInputSize);
oprot.writeFieldEnd();
oprot.writeFieldStop();
oprot.writeStructEnd();
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("ActualPoolInfoArgs(");
boolean first = true;
sb.append("poolInfoString:");
if (this.poolInfoString == null) {
sb.append("null");
} else {
sb.append(this.poolInfoString);
}
first = false;
if (!first) sb.append(", ");
sb.append("jobInputSize:");
sb.append(this.jobInputSize);
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
if (poolInfoString == null) {
throw new org.apache.thrift.protocol.TProtocolException("Required field 'poolInfoString' was not present! Struct: " + toString());
}
// alas, we cannot check 'jobInputSize' because it's a primitive and you chose the non-beans generator.
}
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_bit_vector = new BitSet(1);
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);
}
}
}