/**
* Autogenerated by Thrift
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
*/
package com.flaptor.indextank.rpc;
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.*;
@SuppressWarnings("all") public class IndexLogInfo implements TBase<IndexLogInfo, IndexLogInfo._Fields>, java.io.Serializable, Cloneable {
private static final TStruct STRUCT_DESC = new TStruct("IndexLogInfo");
private static final TField OPTIMIZED_SEGMENTS_FIELD_DESC = new TField("optimized_segments", TType.LIST, (short)1);
private static final TField SORTED_SEGMENTS_FIELD_DESC = new TField("sorted_segments", TType.LIST, (short)2);
private static final TField UNSORTED_SEGMENTS_FIELD_DESC = new TField("unsorted_segments", TType.LIST, (short)3);
private static final TField OPTIMIZED_RECORD_COUNT_FIELD_DESC = new TField("optimized_record_count", TType.I64, (short)4);
private static final TField UNOPTIMIZED_RECORD_COUNT_FIELD_DESC = new TField("unoptimized_record_count", TType.I64, (short)5);
private static final TField UNOPTIMIZED_SEGMENTS_FIELD_DESC = new TField("unoptimized_segments", TType.I32, (short)6);
private static final TField LAST_OPTIMIZATION_TIMESTAMP_FIELD_DESC = new TField("last_optimization_timestamp", TType.I64, (short)7);
private List<SegmentInfo> optimized_segments;
private List<SegmentInfo> sorted_segments;
private List<SegmentInfo> unsorted_segments;
private long optimized_record_count;
private long unoptimized_record_count;
private int unoptimized_segments;
private long last_optimization_timestamp;
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements TFieldIdEnum {
OPTIMIZED_SEGMENTS((short)1, "optimized_segments"),
SORTED_SEGMENTS((short)2, "sorted_segments"),
UNSORTED_SEGMENTS((short)3, "unsorted_segments"),
OPTIMIZED_RECORD_COUNT((short)4, "optimized_record_count"),
UNOPTIMIZED_RECORD_COUNT((short)5, "unoptimized_record_count"),
UNOPTIMIZED_SEGMENTS((short)6, "unoptimized_segments"),
LAST_OPTIMIZATION_TIMESTAMP((short)7, "last_optimization_timestamp");
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: // OPTIMIZED_SEGMENTS
return OPTIMIZED_SEGMENTS;
case 2: // SORTED_SEGMENTS
return SORTED_SEGMENTS;
case 3: // UNSORTED_SEGMENTS
return UNSORTED_SEGMENTS;
case 4: // OPTIMIZED_RECORD_COUNT
return OPTIMIZED_RECORD_COUNT;
case 5: // UNOPTIMIZED_RECORD_COUNT
return UNOPTIMIZED_RECORD_COUNT;
case 6: // UNOPTIMIZED_SEGMENTS
return UNOPTIMIZED_SEGMENTS;
case 7: // LAST_OPTIMIZATION_TIMESTAMP
return LAST_OPTIMIZATION_TIMESTAMP;
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 __OPTIMIZED_RECORD_COUNT_ISSET_ID = 0;
private static final int __UNOPTIMIZED_RECORD_COUNT_ISSET_ID = 1;
private static final int __UNOPTIMIZED_SEGMENTS_ISSET_ID = 2;
private static final int __LAST_OPTIMIZATION_TIMESTAMP_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.OPTIMIZED_SEGMENTS, new FieldMetaData("optimized_segments", TFieldRequirementType.DEFAULT,
new ListMetaData(TType.LIST,
new StructMetaData(TType.STRUCT, SegmentInfo.class))));
tmpMap.put(_Fields.SORTED_SEGMENTS, new FieldMetaData("sorted_segments", TFieldRequirementType.DEFAULT,
new ListMetaData(TType.LIST,
new StructMetaData(TType.STRUCT, SegmentInfo.class))));
tmpMap.put(_Fields.UNSORTED_SEGMENTS, new FieldMetaData("unsorted_segments", TFieldRequirementType.DEFAULT,
new ListMetaData(TType.LIST,
new StructMetaData(TType.STRUCT, SegmentInfo.class))));
tmpMap.put(_Fields.OPTIMIZED_RECORD_COUNT, new FieldMetaData("optimized_record_count", TFieldRequirementType.DEFAULT,
new FieldValueMetaData(TType.I64)));
tmpMap.put(_Fields.UNOPTIMIZED_RECORD_COUNT, new FieldMetaData("unoptimized_record_count", TFieldRequirementType.DEFAULT,
new FieldValueMetaData(TType.I64)));
tmpMap.put(_Fields.UNOPTIMIZED_SEGMENTS, new FieldMetaData("unoptimized_segments", TFieldRequirementType.DEFAULT,
new FieldValueMetaData(TType.I32)));
tmpMap.put(_Fields.LAST_OPTIMIZATION_TIMESTAMP, new FieldMetaData("last_optimization_timestamp", TFieldRequirementType.DEFAULT,
new FieldValueMetaData(TType.I64)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
FieldMetaData.addStructMetaDataMap(IndexLogInfo.class, metaDataMap);
}
public IndexLogInfo() {
}
public IndexLogInfo(
List<SegmentInfo> optimized_segments,
List<SegmentInfo> sorted_segments,
List<SegmentInfo> unsorted_segments,
long optimized_record_count,
long unoptimized_record_count,
int unoptimized_segments,
long last_optimization_timestamp)
{
this();
this.optimized_segments = optimized_segments;
this.sorted_segments = sorted_segments;
this.unsorted_segments = unsorted_segments;
this.optimized_record_count = optimized_record_count;
set_optimized_record_count_isSet(true);
this.unoptimized_record_count = unoptimized_record_count;
set_unoptimized_record_count_isSet(true);
this.unoptimized_segments = unoptimized_segments;
set_unoptimized_segments_isSet(true);
this.last_optimization_timestamp = last_optimization_timestamp;
set_last_optimization_timestamp_isSet(true);
}
/**
* Performs a deep copy on <i>other</i>.
*/
public IndexLogInfo(IndexLogInfo other) {
__isset_bit_vector.clear();
__isset_bit_vector.or(other.__isset_bit_vector);
if (other.is_set_optimized_segments()) {
List<SegmentInfo> __this__optimized_segments = new ArrayList<SegmentInfo>();
for (SegmentInfo other_element : other.optimized_segments) {
__this__optimized_segments.add(new SegmentInfo(other_element));
}
this.optimized_segments = __this__optimized_segments;
}
if (other.is_set_sorted_segments()) {
List<SegmentInfo> __this__sorted_segments = new ArrayList<SegmentInfo>();
for (SegmentInfo other_element : other.sorted_segments) {
__this__sorted_segments.add(new SegmentInfo(other_element));
}
this.sorted_segments = __this__sorted_segments;
}
if (other.is_set_unsorted_segments()) {
List<SegmentInfo> __this__unsorted_segments = new ArrayList<SegmentInfo>();
for (SegmentInfo other_element : other.unsorted_segments) {
__this__unsorted_segments.add(new SegmentInfo(other_element));
}
this.unsorted_segments = __this__unsorted_segments;
}
this.optimized_record_count = other.optimized_record_count;
this.unoptimized_record_count = other.unoptimized_record_count;
this.unoptimized_segments = other.unoptimized_segments;
this.last_optimization_timestamp = other.last_optimization_timestamp;
}
public IndexLogInfo deepCopy() {
return new IndexLogInfo(this);
}
@Override
public void clear() {
this.optimized_segments = null;
this.sorted_segments = null;
this.unsorted_segments = null;
set_optimized_record_count_isSet(false);
this.optimized_record_count = 0;
set_unoptimized_record_count_isSet(false);
this.unoptimized_record_count = 0;
set_unoptimized_segments_isSet(false);
this.unoptimized_segments = 0;
set_last_optimization_timestamp_isSet(false);
this.last_optimization_timestamp = 0;
}
public int get_optimized_segments_size() {
return (this.optimized_segments == null) ? 0 : this.optimized_segments.size();
}
public java.util.Iterator<SegmentInfo> get_optimized_segments_iterator() {
return (this.optimized_segments == null) ? null : this.optimized_segments.iterator();
}
public void add_to_optimized_segments(SegmentInfo elem) {
if (this.optimized_segments == null) {
this.optimized_segments = new ArrayList<SegmentInfo>();
}
this.optimized_segments.add(elem);
}
public List<SegmentInfo> get_optimized_segments() {
return this.optimized_segments;
}
public IndexLogInfo set_optimized_segments(List<SegmentInfo> optimized_segments) {
this.optimized_segments = optimized_segments;
return this;
}
public void unset_optimized_segments() {
this.optimized_segments = null;
}
/** Returns true if field optimized_segments is set (has been asigned a value) and false otherwise */
public boolean is_set_optimized_segments() {
return this.optimized_segments != null;
}
public void set_optimized_segments_isSet(boolean value) {
if (!value) {
this.optimized_segments = null;
}
}
public int get_sorted_segments_size() {
return (this.sorted_segments == null) ? 0 : this.sorted_segments.size();
}
public java.util.Iterator<SegmentInfo> get_sorted_segments_iterator() {
return (this.sorted_segments == null) ? null : this.sorted_segments.iterator();
}
public void add_to_sorted_segments(SegmentInfo elem) {
if (this.sorted_segments == null) {
this.sorted_segments = new ArrayList<SegmentInfo>();
}
this.sorted_segments.add(elem);
}
public List<SegmentInfo> get_sorted_segments() {
return this.sorted_segments;
}
public IndexLogInfo set_sorted_segments(List<SegmentInfo> sorted_segments) {
this.sorted_segments = sorted_segments;
return this;
}
public void unset_sorted_segments() {
this.sorted_segments = null;
}
/** Returns true if field sorted_segments is set (has been asigned a value) and false otherwise */
public boolean is_set_sorted_segments() {
return this.sorted_segments != null;
}
public void set_sorted_segments_isSet(boolean value) {
if (!value) {
this.sorted_segments = null;
}
}
public int get_unsorted_segments_size() {
return (this.unsorted_segments == null) ? 0 : this.unsorted_segments.size();
}
public java.util.Iterator<SegmentInfo> get_unsorted_segments_iterator() {
return (this.unsorted_segments == null) ? null : this.unsorted_segments.iterator();
}
public void add_to_unsorted_segments(SegmentInfo elem) {
if (this.unsorted_segments == null) {
this.unsorted_segments = new ArrayList<SegmentInfo>();
}
this.unsorted_segments.add(elem);
}
public List<SegmentInfo> get_unsorted_segments() {
return this.unsorted_segments;
}
public IndexLogInfo set_unsorted_segments(List<SegmentInfo> unsorted_segments) {
this.unsorted_segments = unsorted_segments;
return this;
}
public void unset_unsorted_segments() {
this.unsorted_segments = null;
}
/** Returns true if field unsorted_segments is set (has been asigned a value) and false otherwise */
public boolean is_set_unsorted_segments() {
return this.unsorted_segments != null;
}
public void set_unsorted_segments_isSet(boolean value) {
if (!value) {
this.unsorted_segments = null;
}
}
public long get_optimized_record_count() {
return this.optimized_record_count;
}
public IndexLogInfo set_optimized_record_count(long optimized_record_count) {
this.optimized_record_count = optimized_record_count;
set_optimized_record_count_isSet(true);
return this;
}
public void unset_optimized_record_count() {
__isset_bit_vector.clear(__OPTIMIZED_RECORD_COUNT_ISSET_ID);
}
/** Returns true if field optimized_record_count is set (has been asigned a value) and false otherwise */
public boolean is_set_optimized_record_count() {
return __isset_bit_vector.get(__OPTIMIZED_RECORD_COUNT_ISSET_ID);
}
public void set_optimized_record_count_isSet(boolean value) {
__isset_bit_vector.set(__OPTIMIZED_RECORD_COUNT_ISSET_ID, value);
}
public long get_unoptimized_record_count() {
return this.unoptimized_record_count;
}
public IndexLogInfo set_unoptimized_record_count(long unoptimized_record_count) {
this.unoptimized_record_count = unoptimized_record_count;
set_unoptimized_record_count_isSet(true);
return this;
}
public void unset_unoptimized_record_count() {
__isset_bit_vector.clear(__UNOPTIMIZED_RECORD_COUNT_ISSET_ID);
}
/** Returns true if field unoptimized_record_count is set (has been asigned a value) and false otherwise */
public boolean is_set_unoptimized_record_count() {
return __isset_bit_vector.get(__UNOPTIMIZED_RECORD_COUNT_ISSET_ID);
}
public void set_unoptimized_record_count_isSet(boolean value) {
__isset_bit_vector.set(__UNOPTIMIZED_RECORD_COUNT_ISSET_ID, value);
}
public int get_unoptimized_segments() {
return this.unoptimized_segments;
}
public IndexLogInfo set_unoptimized_segments(int unoptimized_segments) {
this.unoptimized_segments = unoptimized_segments;
set_unoptimized_segments_isSet(true);
return this;
}
public void unset_unoptimized_segments() {
__isset_bit_vector.clear(__UNOPTIMIZED_SEGMENTS_ISSET_ID);
}
/** Returns true if field unoptimized_segments is set (has been asigned a value) and false otherwise */
public boolean is_set_unoptimized_segments() {
return __isset_bit_vector.get(__UNOPTIMIZED_SEGMENTS_ISSET_ID);
}
public void set_unoptimized_segments_isSet(boolean value) {
__isset_bit_vector.set(__UNOPTIMIZED_SEGMENTS_ISSET_ID, value);
}
public long get_last_optimization_timestamp() {
return this.last_optimization_timestamp;
}
public IndexLogInfo set_last_optimization_timestamp(long last_optimization_timestamp) {
this.last_optimization_timestamp = last_optimization_timestamp;
set_last_optimization_timestamp_isSet(true);
return this;
}
public void unset_last_optimization_timestamp() {
__isset_bit_vector.clear(__LAST_OPTIMIZATION_TIMESTAMP_ISSET_ID);
}
/** Returns true if field last_optimization_timestamp is set (has been asigned a value) and false otherwise */
public boolean is_set_last_optimization_timestamp() {
return __isset_bit_vector.get(__LAST_OPTIMIZATION_TIMESTAMP_ISSET_ID);
}
public void set_last_optimization_timestamp_isSet(boolean value) {
__isset_bit_vector.set(__LAST_OPTIMIZATION_TIMESTAMP_ISSET_ID, value);
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case OPTIMIZED_SEGMENTS:
if (value == null) {
unset_optimized_segments();
} else {
set_optimized_segments((List<SegmentInfo>)value);
}
break;
case SORTED_SEGMENTS:
if (value == null) {
unset_sorted_segments();
} else {
set_sorted_segments((List<SegmentInfo>)value);
}
break;
case UNSORTED_SEGMENTS:
if (value == null) {
unset_unsorted_segments();
} else {
set_unsorted_segments((List<SegmentInfo>)value);
}
break;
case OPTIMIZED_RECORD_COUNT:
if (value == null) {
unset_optimized_record_count();
} else {
set_optimized_record_count((Long)value);
}
break;
case UNOPTIMIZED_RECORD_COUNT:
if (value == null) {
unset_unoptimized_record_count();
} else {
set_unoptimized_record_count((Long)value);
}
break;
case UNOPTIMIZED_SEGMENTS:
if (value == null) {
unset_unoptimized_segments();
} else {
set_unoptimized_segments((Integer)value);
}
break;
case LAST_OPTIMIZATION_TIMESTAMP:
if (value == null) {
unset_last_optimization_timestamp();
} else {
set_last_optimization_timestamp((Long)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case OPTIMIZED_SEGMENTS:
return get_optimized_segments();
case SORTED_SEGMENTS:
return get_sorted_segments();
case UNSORTED_SEGMENTS:
return get_unsorted_segments();
case OPTIMIZED_RECORD_COUNT:
return new Long(get_optimized_record_count());
case UNOPTIMIZED_RECORD_COUNT:
return new Long(get_unoptimized_record_count());
case UNOPTIMIZED_SEGMENTS:
return new Integer(get_unoptimized_segments());
case LAST_OPTIMIZATION_TIMESTAMP:
return new Long(get_last_optimization_timestamp());
}
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 OPTIMIZED_SEGMENTS:
return is_set_optimized_segments();
case SORTED_SEGMENTS:
return is_set_sorted_segments();
case UNSORTED_SEGMENTS:
return is_set_unsorted_segments();
case OPTIMIZED_RECORD_COUNT:
return is_set_optimized_record_count();
case UNOPTIMIZED_RECORD_COUNT:
return is_set_unoptimized_record_count();
case UNOPTIMIZED_SEGMENTS:
return is_set_unoptimized_segments();
case LAST_OPTIMIZATION_TIMESTAMP:
return is_set_last_optimization_timestamp();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof IndexLogInfo)
return this.equals((IndexLogInfo)that);
return false;
}
public boolean equals(IndexLogInfo that) {
if (that == null)
return false;
boolean this_present_optimized_segments = true && this.is_set_optimized_segments();
boolean that_present_optimized_segments = true && that.is_set_optimized_segments();
if (this_present_optimized_segments || that_present_optimized_segments) {
if (!(this_present_optimized_segments && that_present_optimized_segments))
return false;
if (!this.optimized_segments.equals(that.optimized_segments))
return false;
}
boolean this_present_sorted_segments = true && this.is_set_sorted_segments();
boolean that_present_sorted_segments = true && that.is_set_sorted_segments();
if (this_present_sorted_segments || that_present_sorted_segments) {
if (!(this_present_sorted_segments && that_present_sorted_segments))
return false;
if (!this.sorted_segments.equals(that.sorted_segments))
return false;
}
boolean this_present_unsorted_segments = true && this.is_set_unsorted_segments();
boolean that_present_unsorted_segments = true && that.is_set_unsorted_segments();
if (this_present_unsorted_segments || that_present_unsorted_segments) {
if (!(this_present_unsorted_segments && that_present_unsorted_segments))
return false;
if (!this.unsorted_segments.equals(that.unsorted_segments))
return false;
}
boolean this_present_optimized_record_count = true;
boolean that_present_optimized_record_count = true;
if (this_present_optimized_record_count || that_present_optimized_record_count) {
if (!(this_present_optimized_record_count && that_present_optimized_record_count))
return false;
if (this.optimized_record_count != that.optimized_record_count)
return false;
}
boolean this_present_unoptimized_record_count = true;
boolean that_present_unoptimized_record_count = true;
if (this_present_unoptimized_record_count || that_present_unoptimized_record_count) {
if (!(this_present_unoptimized_record_count && that_present_unoptimized_record_count))
return false;
if (this.unoptimized_record_count != that.unoptimized_record_count)
return false;
}
boolean this_present_unoptimized_segments = true;
boolean that_present_unoptimized_segments = true;
if (this_present_unoptimized_segments || that_present_unoptimized_segments) {
if (!(this_present_unoptimized_segments && that_present_unoptimized_segments))
return false;
if (this.unoptimized_segments != that.unoptimized_segments)
return false;
}
boolean this_present_last_optimization_timestamp = true;
boolean that_present_last_optimization_timestamp = true;
if (this_present_last_optimization_timestamp || that_present_last_optimization_timestamp) {
if (!(this_present_last_optimization_timestamp && that_present_last_optimization_timestamp))
return false;
if (this.last_optimization_timestamp != that.last_optimization_timestamp)
return false;
}
return true;
}
@Override
public int hashCode() {
return 0;
}
public int compareTo(IndexLogInfo other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
IndexLogInfo typedOther = (IndexLogInfo)other;
lastComparison = Boolean.valueOf(is_set_optimized_segments()).compareTo(typedOther.is_set_optimized_segments());
if (lastComparison != 0) {
return lastComparison;
}
if (is_set_optimized_segments()) {
lastComparison = TBaseHelper.compareTo(this.optimized_segments, typedOther.optimized_segments);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(is_set_sorted_segments()).compareTo(typedOther.is_set_sorted_segments());
if (lastComparison != 0) {
return lastComparison;
}
if (is_set_sorted_segments()) {
lastComparison = TBaseHelper.compareTo(this.sorted_segments, typedOther.sorted_segments);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(is_set_unsorted_segments()).compareTo(typedOther.is_set_unsorted_segments());
if (lastComparison != 0) {
return lastComparison;
}
if (is_set_unsorted_segments()) {
lastComparison = TBaseHelper.compareTo(this.unsorted_segments, typedOther.unsorted_segments);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(is_set_optimized_record_count()).compareTo(typedOther.is_set_optimized_record_count());
if (lastComparison != 0) {
return lastComparison;
}
if (is_set_optimized_record_count()) {
lastComparison = TBaseHelper.compareTo(this.optimized_record_count, typedOther.optimized_record_count);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(is_set_unoptimized_record_count()).compareTo(typedOther.is_set_unoptimized_record_count());
if (lastComparison != 0) {
return lastComparison;
}
if (is_set_unoptimized_record_count()) {
lastComparison = TBaseHelper.compareTo(this.unoptimized_record_count, typedOther.unoptimized_record_count);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(is_set_unoptimized_segments()).compareTo(typedOther.is_set_unoptimized_segments());
if (lastComparison != 0) {
return lastComparison;
}
if (is_set_unoptimized_segments()) {
lastComparison = TBaseHelper.compareTo(this.unoptimized_segments, typedOther.unoptimized_segments);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(is_set_last_optimization_timestamp()).compareTo(typedOther.is_set_last_optimization_timestamp());
if (lastComparison != 0) {
return lastComparison;
}
if (is_set_last_optimization_timestamp()) {
lastComparison = TBaseHelper.compareTo(this.last_optimization_timestamp, typedOther.last_optimization_timestamp);
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: // OPTIMIZED_SEGMENTS
if (field.type == TType.LIST) {
{
TList _list82 = iprot.readListBegin();
this.optimized_segments = new ArrayList<SegmentInfo>(_list82.size);
for (int _i83 = 0; _i83 < _list82.size; ++_i83)
{
SegmentInfo _elem84;
_elem84 = new SegmentInfo();
_elem84.read(iprot);
this.optimized_segments.add(_elem84);
}
iprot.readListEnd();
}
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case 2: // SORTED_SEGMENTS
if (field.type == TType.LIST) {
{
TList _list85 = iprot.readListBegin();
this.sorted_segments = new ArrayList<SegmentInfo>(_list85.size);
for (int _i86 = 0; _i86 < _list85.size; ++_i86)
{
SegmentInfo _elem87;
_elem87 = new SegmentInfo();
_elem87.read(iprot);
this.sorted_segments.add(_elem87);
}
iprot.readListEnd();
}
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case 3: // UNSORTED_SEGMENTS
if (field.type == TType.LIST) {
{
TList _list88 = iprot.readListBegin();
this.unsorted_segments = new ArrayList<SegmentInfo>(_list88.size);
for (int _i89 = 0; _i89 < _list88.size; ++_i89)
{
SegmentInfo _elem90;
_elem90 = new SegmentInfo();
_elem90.read(iprot);
this.unsorted_segments.add(_elem90);
}
iprot.readListEnd();
}
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case 4: // OPTIMIZED_RECORD_COUNT
if (field.type == TType.I64) {
this.optimized_record_count = iprot.readI64();
set_optimized_record_count_isSet(true);
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case 5: // UNOPTIMIZED_RECORD_COUNT
if (field.type == TType.I64) {
this.unoptimized_record_count = iprot.readI64();
set_unoptimized_record_count_isSet(true);
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case 6: // UNOPTIMIZED_SEGMENTS
if (field.type == TType.I32) {
this.unoptimized_segments = iprot.readI32();
set_unoptimized_segments_isSet(true);
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case 7: // LAST_OPTIMIZATION_TIMESTAMP
if (field.type == TType.I64) {
this.last_optimization_timestamp = iprot.readI64();
set_last_optimization_timestamp_isSet(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.optimized_segments != null) {
oprot.writeFieldBegin(OPTIMIZED_SEGMENTS_FIELD_DESC);
{
oprot.writeListBegin(new TList(TType.STRUCT, this.optimized_segments.size()));
for (SegmentInfo _iter91 : this.optimized_segments)
{
_iter91.write(oprot);
}
oprot.writeListEnd();
}
oprot.writeFieldEnd();
}
if (this.sorted_segments != null) {
oprot.writeFieldBegin(SORTED_SEGMENTS_FIELD_DESC);
{
oprot.writeListBegin(new TList(TType.STRUCT, this.sorted_segments.size()));
for (SegmentInfo _iter92 : this.sorted_segments)
{
_iter92.write(oprot);
}
oprot.writeListEnd();
}
oprot.writeFieldEnd();
}
if (this.unsorted_segments != null) {
oprot.writeFieldBegin(UNSORTED_SEGMENTS_FIELD_DESC);
{
oprot.writeListBegin(new TList(TType.STRUCT, this.unsorted_segments.size()));
for (SegmentInfo _iter93 : this.unsorted_segments)
{
_iter93.write(oprot);
}
oprot.writeListEnd();
}
oprot.writeFieldEnd();
}
oprot.writeFieldBegin(OPTIMIZED_RECORD_COUNT_FIELD_DESC);
oprot.writeI64(this.optimized_record_count);
oprot.writeFieldEnd();
oprot.writeFieldBegin(UNOPTIMIZED_RECORD_COUNT_FIELD_DESC);
oprot.writeI64(this.unoptimized_record_count);
oprot.writeFieldEnd();
oprot.writeFieldBegin(UNOPTIMIZED_SEGMENTS_FIELD_DESC);
oprot.writeI32(this.unoptimized_segments);
oprot.writeFieldEnd();
oprot.writeFieldBegin(LAST_OPTIMIZATION_TIMESTAMP_FIELD_DESC);
oprot.writeI64(this.last_optimization_timestamp);
oprot.writeFieldEnd();
oprot.writeFieldStop();
oprot.writeStructEnd();
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("IndexLogInfo(");
boolean first = true;
sb.append("optimized_segments:");
if (this.optimized_segments == null) {
sb.append("null");
} else {
sb.append(this.optimized_segments);
}
first = false;
if (!first) sb.append(", ");
sb.append("sorted_segments:");
if (this.sorted_segments == null) {
sb.append("null");
} else {
sb.append(this.sorted_segments);
}
first = false;
if (!first) sb.append(", ");
sb.append("unsorted_segments:");
if (this.unsorted_segments == null) {
sb.append("null");
} else {
sb.append(this.unsorted_segments);
}
first = false;
if (!first) sb.append(", ");
sb.append("optimized_record_count:");
sb.append(this.optimized_record_count);
first = false;
if (!first) sb.append(", ");
sb.append("unoptimized_record_count:");
sb.append(this.unoptimized_record_count);
first = false;
if (!first) sb.append(", ");
sb.append("unoptimized_segments:");
sb.append(this.unoptimized_segments);
first = false;
if (!first) sb.append(", ");
sb.append("last_optimization_timestamp:");
sb.append(this.last_optimization_timestamp);
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws TException {
// check for required fields
}
}