/**
* 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 SessionInfo implements org.apache.thrift.TBase<SessionInfo, SessionInfo._Fields>, java.io.Serializable, Cloneable {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("SessionInfo");
private static final org.apache.thrift.protocol.TField ADDRESS_FIELD_DESC = new org.apache.thrift.protocol.TField("address", org.apache.thrift.protocol.TType.STRUCT, (short)1);
private static final org.apache.thrift.protocol.TField NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("name", org.apache.thrift.protocol.TType.STRING, (short)2);
private static final org.apache.thrift.protocol.TField USER_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("userId", org.apache.thrift.protocol.TType.STRING, (short)3);
private static final org.apache.thrift.protocol.TField GROUP_IDS_FIELD_DESC = new org.apache.thrift.protocol.TField("groupIds", org.apache.thrift.protocol.TType.LIST, (short)4);
private static final org.apache.thrift.protocol.TField POOL_INFO_STRINGS_FIELD_DESC = new org.apache.thrift.protocol.TField("poolInfoStrings", org.apache.thrift.protocol.TType.STRUCT, (short)5);
private static final org.apache.thrift.protocol.TField PRIORITY_FIELD_DESC = new org.apache.thrift.protocol.TField("priority", org.apache.thrift.protocol.TType.I32, (short)6);
private static final org.apache.thrift.protocol.TField NO_PREEMPT_FIELD_DESC = new org.apache.thrift.protocol.TField("noPreempt", org.apache.thrift.protocol.TType.BOOL, (short)7);
private static final org.apache.thrift.protocol.TField URL_FIELD_DESC = new org.apache.thrift.protocol.TField("url", org.apache.thrift.protocol.TType.STRING, (short)8);
private static final org.apache.thrift.protocol.TField DEADLINE_FIELD_DESC = new org.apache.thrift.protocol.TField("deadline", org.apache.thrift.protocol.TType.I64, (short)9);
public InetAddress address; // required
public String name; // required
public String userId; // required
public List<String> groupIds; // required
public PoolInfoStrings poolInfoStrings; // required
/**
*
* @see SessionPriority
*/
public SessionPriority priority; // required
public boolean noPreempt; // required
public String url; // required
public long deadline; // 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 {
ADDRESS((short)1, "address"),
NAME((short)2, "name"),
USER_ID((short)3, "userId"),
GROUP_IDS((short)4, "groupIds"),
POOL_INFO_STRINGS((short)5, "poolInfoStrings"),
/**
*
* @see SessionPriority
*/
PRIORITY((short)6, "priority"),
NO_PREEMPT((short)7, "noPreempt"),
URL((short)8, "url"),
DEADLINE((short)9, "deadline");
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: // ADDRESS
return ADDRESS;
case 2: // NAME
return NAME;
case 3: // USER_ID
return USER_ID;
case 4: // GROUP_IDS
return GROUP_IDS;
case 5: // POOL_INFO_STRINGS
return POOL_INFO_STRINGS;
case 6: // PRIORITY
return PRIORITY;
case 7: // NO_PREEMPT
return NO_PREEMPT;
case 8: // URL
return URL;
case 9: // DEADLINE
return DEADLINE;
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 __NOPREEMPT_ISSET_ID = 0;
private static final int __DEADLINE_ISSET_ID = 1;
private BitSet __isset_bit_vector = new BitSet(2);
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.ADDRESS, new org.apache.thrift.meta_data.FieldMetaData("address", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, InetAddress.class)));
tmpMap.put(_Fields.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.USER_ID, new org.apache.thrift.meta_data.FieldMetaData("userId", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.GROUP_IDS, new org.apache.thrift.meta_data.FieldMetaData("groupIds", 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.POOL_INFO_STRINGS, new org.apache.thrift.meta_data.FieldMetaData("poolInfoStrings", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, PoolInfoStrings.class)));
tmpMap.put(_Fields.PRIORITY, new org.apache.thrift.meta_data.FieldMetaData("priority", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, SessionPriority.class)));
tmpMap.put(_Fields.NO_PREEMPT, new org.apache.thrift.meta_data.FieldMetaData("noPreempt", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
tmpMap.put(_Fields.URL, new org.apache.thrift.meta_data.FieldMetaData("url", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.DEADLINE, new org.apache.thrift.meta_data.FieldMetaData("deadline", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(SessionInfo.class, metaDataMap);
}
public SessionInfo() {
}
public SessionInfo(
InetAddress address,
String name,
String userId)
{
this();
this.address = address;
this.name = name;
this.userId = userId;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public SessionInfo(SessionInfo other) {
__isset_bit_vector.clear();
__isset_bit_vector.or(other.__isset_bit_vector);
if (other.isSetAddress()) {
this.address = new InetAddress(other.address);
}
if (other.isSetName()) {
this.name = other.name;
}
if (other.isSetUserId()) {
this.userId = other.userId;
}
if (other.isSetGroupIds()) {
List<String> __this__groupIds = new ArrayList<String>();
for (String other_element : other.groupIds) {
__this__groupIds.add(other_element);
}
this.groupIds = __this__groupIds;
}
if (other.isSetPoolInfoStrings()) {
this.poolInfoStrings = new PoolInfoStrings(other.poolInfoStrings);
}
if (other.isSetPriority()) {
this.priority = other.priority;
}
this.noPreempt = other.noPreempt;
if (other.isSetUrl()) {
this.url = other.url;
}
this.deadline = other.deadline;
}
public SessionInfo deepCopy() {
return new SessionInfo(this);
}
@Override
public void clear() {
this.address = null;
this.name = null;
this.userId = null;
this.groupIds = null;
this.poolInfoStrings = null;
this.priority = null;
setNoPreemptIsSet(false);
this.noPreempt = false;
this.url = null;
setDeadlineIsSet(false);
this.deadline = 0;
}
public InetAddress getAddress() {
return this.address;
}
public SessionInfo setAddress(InetAddress address) {
this.address = address;
return this;
}
public void unsetAddress() {
this.address = null;
}
/** Returns true if field address is set (has been assigned a value) and false otherwise */
public boolean isSetAddress() {
return this.address != null;
}
public void setAddressIsSet(boolean value) {
if (!value) {
this.address = null;
}
}
public String getName() {
return this.name;
}
public SessionInfo setName(String name) {
this.name = name;
return this;
}
public void unsetName() {
this.name = null;
}
/** Returns true if field name is set (has been assigned a value) and false otherwise */
public boolean isSetName() {
return this.name != null;
}
public void setNameIsSet(boolean value) {
if (!value) {
this.name = null;
}
}
public String getUserId() {
return this.userId;
}
public SessionInfo setUserId(String userId) {
this.userId = userId;
return this;
}
public void unsetUserId() {
this.userId = null;
}
/** Returns true if field userId is set (has been assigned a value) and false otherwise */
public boolean isSetUserId() {
return this.userId != null;
}
public void setUserIdIsSet(boolean value) {
if (!value) {
this.userId = null;
}
}
public int getGroupIdsSize() {
return (this.groupIds == null) ? 0 : this.groupIds.size();
}
public java.util.Iterator<String> getGroupIdsIterator() {
return (this.groupIds == null) ? null : this.groupIds.iterator();
}
public void addToGroupIds(String elem) {
if (this.groupIds == null) {
this.groupIds = new ArrayList<String>();
}
this.groupIds.add(elem);
}
public List<String> getGroupIds() {
return this.groupIds;
}
public SessionInfo setGroupIds(List<String> groupIds) {
this.groupIds = groupIds;
return this;
}
public void unsetGroupIds() {
this.groupIds = null;
}
/** Returns true if field groupIds is set (has been assigned a value) and false otherwise */
public boolean isSetGroupIds() {
return this.groupIds != null;
}
public void setGroupIdsIsSet(boolean value) {
if (!value) {
this.groupIds = null;
}
}
public PoolInfoStrings getPoolInfoStrings() {
return this.poolInfoStrings;
}
public SessionInfo setPoolInfoStrings(PoolInfoStrings poolInfoStrings) {
this.poolInfoStrings = poolInfoStrings;
return this;
}
public void unsetPoolInfoStrings() {
this.poolInfoStrings = null;
}
/** Returns true if field poolInfoStrings is set (has been assigned a value) and false otherwise */
public boolean isSetPoolInfoStrings() {
return this.poolInfoStrings != null;
}
public void setPoolInfoStringsIsSet(boolean value) {
if (!value) {
this.poolInfoStrings = null;
}
}
/**
*
* @see SessionPriority
*/
public SessionPriority getPriority() {
return this.priority;
}
/**
*
* @see SessionPriority
*/
public SessionInfo setPriority(SessionPriority priority) {
this.priority = priority;
return this;
}
public void unsetPriority() {
this.priority = null;
}
/** Returns true if field priority is set (has been assigned a value) and false otherwise */
public boolean isSetPriority() {
return this.priority != null;
}
public void setPriorityIsSet(boolean value) {
if (!value) {
this.priority = null;
}
}
public boolean isNoPreempt() {
return this.noPreempt;
}
public SessionInfo setNoPreempt(boolean noPreempt) {
this.noPreempt = noPreempt;
setNoPreemptIsSet(true);
return this;
}
public void unsetNoPreempt() {
__isset_bit_vector.clear(__NOPREEMPT_ISSET_ID);
}
/** Returns true if field noPreempt is set (has been assigned a value) and false otherwise */
public boolean isSetNoPreempt() {
return __isset_bit_vector.get(__NOPREEMPT_ISSET_ID);
}
public void setNoPreemptIsSet(boolean value) {
__isset_bit_vector.set(__NOPREEMPT_ISSET_ID, value);
}
public String getUrl() {
return this.url;
}
public SessionInfo setUrl(String url) {
this.url = url;
return this;
}
public void unsetUrl() {
this.url = null;
}
/** Returns true if field url is set (has been assigned a value) and false otherwise */
public boolean isSetUrl() {
return this.url != null;
}
public void setUrlIsSet(boolean value) {
if (!value) {
this.url = null;
}
}
public long getDeadline() {
return this.deadline;
}
public SessionInfo setDeadline(long deadline) {
this.deadline = deadline;
setDeadlineIsSet(true);
return this;
}
public void unsetDeadline() {
__isset_bit_vector.clear(__DEADLINE_ISSET_ID);
}
/** Returns true if field deadline is set (has been assigned a value) and false otherwise */
public boolean isSetDeadline() {
return __isset_bit_vector.get(__DEADLINE_ISSET_ID);
}
public void setDeadlineIsSet(boolean value) {
__isset_bit_vector.set(__DEADLINE_ISSET_ID, value);
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case ADDRESS:
if (value == null) {
unsetAddress();
} else {
setAddress((InetAddress)value);
}
break;
case NAME:
if (value == null) {
unsetName();
} else {
setName((String)value);
}
break;
case USER_ID:
if (value == null) {
unsetUserId();
} else {
setUserId((String)value);
}
break;
case GROUP_IDS:
if (value == null) {
unsetGroupIds();
} else {
setGroupIds((List<String>)value);
}
break;
case POOL_INFO_STRINGS:
if (value == null) {
unsetPoolInfoStrings();
} else {
setPoolInfoStrings((PoolInfoStrings)value);
}
break;
case PRIORITY:
if (value == null) {
unsetPriority();
} else {
setPriority((SessionPriority)value);
}
break;
case NO_PREEMPT:
if (value == null) {
unsetNoPreempt();
} else {
setNoPreempt((Boolean)value);
}
break;
case URL:
if (value == null) {
unsetUrl();
} else {
setUrl((String)value);
}
break;
case DEADLINE:
if (value == null) {
unsetDeadline();
} else {
setDeadline((Long)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case ADDRESS:
return getAddress();
case NAME:
return getName();
case USER_ID:
return getUserId();
case GROUP_IDS:
return getGroupIds();
case POOL_INFO_STRINGS:
return getPoolInfoStrings();
case PRIORITY:
return getPriority();
case NO_PREEMPT:
return Boolean.valueOf(isNoPreempt());
case URL:
return getUrl();
case DEADLINE:
return Long.valueOf(getDeadline());
}
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 ADDRESS:
return isSetAddress();
case NAME:
return isSetName();
case USER_ID:
return isSetUserId();
case GROUP_IDS:
return isSetGroupIds();
case POOL_INFO_STRINGS:
return isSetPoolInfoStrings();
case PRIORITY:
return isSetPriority();
case NO_PREEMPT:
return isSetNoPreempt();
case URL:
return isSetUrl();
case DEADLINE:
return isSetDeadline();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof SessionInfo)
return this.equals((SessionInfo)that);
return false;
}
public boolean equals(SessionInfo that) {
if (that == null)
return false;
boolean this_present_address = true && this.isSetAddress();
boolean that_present_address = true && that.isSetAddress();
if (this_present_address || that_present_address) {
if (!(this_present_address && that_present_address))
return false;
if (!this.address.equals(that.address))
return false;
}
boolean this_present_name = true && this.isSetName();
boolean that_present_name = true && that.isSetName();
if (this_present_name || that_present_name) {
if (!(this_present_name && that_present_name))
return false;
if (!this.name.equals(that.name))
return false;
}
boolean this_present_userId = true && this.isSetUserId();
boolean that_present_userId = true && that.isSetUserId();
if (this_present_userId || that_present_userId) {
if (!(this_present_userId && that_present_userId))
return false;
if (!this.userId.equals(that.userId))
return false;
}
boolean this_present_groupIds = true && this.isSetGroupIds();
boolean that_present_groupIds = true && that.isSetGroupIds();
if (this_present_groupIds || that_present_groupIds) {
if (!(this_present_groupIds && that_present_groupIds))
return false;
if (!this.groupIds.equals(that.groupIds))
return false;
}
boolean this_present_poolInfoStrings = true && this.isSetPoolInfoStrings();
boolean that_present_poolInfoStrings = true && that.isSetPoolInfoStrings();
if (this_present_poolInfoStrings || that_present_poolInfoStrings) {
if (!(this_present_poolInfoStrings && that_present_poolInfoStrings))
return false;
if (!this.poolInfoStrings.equals(that.poolInfoStrings))
return false;
}
boolean this_present_priority = true && this.isSetPriority();
boolean that_present_priority = true && that.isSetPriority();
if (this_present_priority || that_present_priority) {
if (!(this_present_priority && that_present_priority))
return false;
if (!this.priority.equals(that.priority))
return false;
}
boolean this_present_noPreempt = true && this.isSetNoPreempt();
boolean that_present_noPreempt = true && that.isSetNoPreempt();
if (this_present_noPreempt || that_present_noPreempt) {
if (!(this_present_noPreempt && that_present_noPreempt))
return false;
if (this.noPreempt != that.noPreempt)
return false;
}
boolean this_present_url = true && this.isSetUrl();
boolean that_present_url = true && that.isSetUrl();
if (this_present_url || that_present_url) {
if (!(this_present_url && that_present_url))
return false;
if (!this.url.equals(that.url))
return false;
}
boolean this_present_deadline = true && this.isSetDeadline();
boolean that_present_deadline = true && that.isSetDeadline();
if (this_present_deadline || that_present_deadline) {
if (!(this_present_deadline && that_present_deadline))
return false;
if (this.deadline != that.deadline)
return false;
}
return true;
}
@Override
public int hashCode() {
return 0;
}
public int compareTo(SessionInfo other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
SessionInfo typedOther = (SessionInfo)other;
lastComparison = Boolean.valueOf(isSetAddress()).compareTo(typedOther.isSetAddress());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetAddress()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.address, typedOther.address);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetName()).compareTo(typedOther.isSetName());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetName()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.name, typedOther.name);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetUserId()).compareTo(typedOther.isSetUserId());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetUserId()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userId, typedOther.userId);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetGroupIds()).compareTo(typedOther.isSetGroupIds());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetGroupIds()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.groupIds, typedOther.groupIds);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetPoolInfoStrings()).compareTo(typedOther.isSetPoolInfoStrings());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetPoolInfoStrings()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.poolInfoStrings, typedOther.poolInfoStrings);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetPriority()).compareTo(typedOther.isSetPriority());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetPriority()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.priority, typedOther.priority);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetNoPreempt()).compareTo(typedOther.isSetNoPreempt());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetNoPreempt()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.noPreempt, typedOther.noPreempt);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetUrl()).compareTo(typedOther.isSetUrl());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetUrl()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.url, typedOther.url);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetDeadline()).compareTo(typedOther.isSetDeadline());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetDeadline()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.deadline, typedOther.deadline);
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: // ADDRESS
if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
this.address = new InetAddress();
this.address.read(iprot);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
}
break;
case 2: // NAME
if (field.type == org.apache.thrift.protocol.TType.STRING) {
this.name = iprot.readString();
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
}
break;
case 3: // USER_ID
if (field.type == org.apache.thrift.protocol.TType.STRING) {
this.userId = iprot.readString();
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
}
break;
case 4: // GROUP_IDS
if (field.type == org.apache.thrift.protocol.TType.LIST) {
{
org.apache.thrift.protocol.TList _list13 = iprot.readListBegin();
this.groupIds = new ArrayList<String>(_list13.size);
for (int _i14 = 0; _i14 < _list13.size; ++_i14)
{
String _elem15; // required
_elem15 = iprot.readString();
this.groupIds.add(_elem15);
}
iprot.readListEnd();
}
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
}
break;
case 5: // POOL_INFO_STRINGS
if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
this.poolInfoStrings = new PoolInfoStrings();
this.poolInfoStrings.read(iprot);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
}
break;
case 6: // PRIORITY
if (field.type == org.apache.thrift.protocol.TType.I32) {
this.priority = SessionPriority.findByValue(iprot.readI32());
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
}
break;
case 7: // NO_PREEMPT
if (field.type == org.apache.thrift.protocol.TType.BOOL) {
this.noPreempt = iprot.readBool();
setNoPreemptIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
}
break;
case 8: // URL
if (field.type == org.apache.thrift.protocol.TType.STRING) {
this.url = iprot.readString();
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
}
break;
case 9: // DEADLINE
if (field.type == org.apache.thrift.protocol.TType.I64) {
this.deadline = iprot.readI64();
setDeadlineIsSet(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
validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
validate();
oprot.writeStructBegin(STRUCT_DESC);
if (this.address != null) {
oprot.writeFieldBegin(ADDRESS_FIELD_DESC);
this.address.write(oprot);
oprot.writeFieldEnd();
}
if (this.name != null) {
oprot.writeFieldBegin(NAME_FIELD_DESC);
oprot.writeString(this.name);
oprot.writeFieldEnd();
}
if (this.userId != null) {
oprot.writeFieldBegin(USER_ID_FIELD_DESC);
oprot.writeString(this.userId);
oprot.writeFieldEnd();
}
if (this.groupIds != null) {
if (isSetGroupIds()) {
oprot.writeFieldBegin(GROUP_IDS_FIELD_DESC);
{
oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, this.groupIds.size()));
for (String _iter16 : this.groupIds)
{
oprot.writeString(_iter16);
}
oprot.writeListEnd();
}
oprot.writeFieldEnd();
}
}
if (this.poolInfoStrings != null) {
if (isSetPoolInfoStrings()) {
oprot.writeFieldBegin(POOL_INFO_STRINGS_FIELD_DESC);
this.poolInfoStrings.write(oprot);
oprot.writeFieldEnd();
}
}
if (this.priority != null) {
if (isSetPriority()) {
oprot.writeFieldBegin(PRIORITY_FIELD_DESC);
oprot.writeI32(this.priority.getValue());
oprot.writeFieldEnd();
}
}
if (isSetNoPreempt()) {
oprot.writeFieldBegin(NO_PREEMPT_FIELD_DESC);
oprot.writeBool(this.noPreempt);
oprot.writeFieldEnd();
}
if (this.url != null) {
if (isSetUrl()) {
oprot.writeFieldBegin(URL_FIELD_DESC);
oprot.writeString(this.url);
oprot.writeFieldEnd();
}
}
if (isSetDeadline()) {
oprot.writeFieldBegin(DEADLINE_FIELD_DESC);
oprot.writeI64(this.deadline);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("SessionInfo(");
boolean first = true;
sb.append("address:");
if (this.address == null) {
sb.append("null");
} else {
sb.append(this.address);
}
first = false;
if (!first) sb.append(", ");
sb.append("name:");
if (this.name == null) {
sb.append("null");
} else {
sb.append(this.name);
}
first = false;
if (!first) sb.append(", ");
sb.append("userId:");
if (this.userId == null) {
sb.append("null");
} else {
sb.append(this.userId);
}
first = false;
if (isSetGroupIds()) {
if (!first) sb.append(", ");
sb.append("groupIds:");
if (this.groupIds == null) {
sb.append("null");
} else {
sb.append(this.groupIds);
}
first = false;
}
if (isSetPoolInfoStrings()) {
if (!first) sb.append(", ");
sb.append("poolInfoStrings:");
if (this.poolInfoStrings == null) {
sb.append("null");
} else {
sb.append(this.poolInfoStrings);
}
first = false;
}
if (isSetPriority()) {
if (!first) sb.append(", ");
sb.append("priority:");
if (this.priority == null) {
sb.append("null");
} else {
sb.append(this.priority);
}
first = false;
}
if (isSetNoPreempt()) {
if (!first) sb.append(", ");
sb.append("noPreempt:");
sb.append(this.noPreempt);
first = false;
}
if (isSetUrl()) {
if (!first) sb.append(", ");
sb.append("url:");
if (this.url == null) {
sb.append("null");
} else {
sb.append(this.url);
}
first = false;
}
if (isSetDeadline()) {
if (!first) sb.append(", ");
sb.append("deadline:");
sb.append(this.deadline);
first = false;
}
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
if (address == null) {
throw new org.apache.thrift.protocol.TProtocolException("Required field 'address' was not present! Struct: " + toString());
}
if (name == null) {
throw new org.apache.thrift.protocol.TProtocolException("Required field 'name' was not present! Struct: " + toString());
}
if (userId == null) {
throw new org.apache.thrift.protocol.TProtocolException("Required field 'userId' was not present! Struct: " + toString());
}
}
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);
}
}
}