/**
* Autogenerated by Thrift Compiler (0.9.2)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
package com.linkedin.pinot.common.request;
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"})
/**
* AUTO GENERATED: DO NOT EDIT
* Broker Query
*
*/
@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2017-4-1")
public class BrokerRequest implements org.apache.thrift.TBase<BrokerRequest, BrokerRequest._Fields>, java.io.Serializable, Cloneable, Comparable<BrokerRequest> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("BrokerRequest");
private static final org.apache.thrift.protocol.TField QUERY_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("queryType", org.apache.thrift.protocol.TType.STRUCT, (short)1);
private static final org.apache.thrift.protocol.TField QUERY_SOURCE_FIELD_DESC = new org.apache.thrift.protocol.TField("querySource", org.apache.thrift.protocol.TType.STRUCT, (short)2);
private static final org.apache.thrift.protocol.TField TIME_INTERVAL_FIELD_DESC = new org.apache.thrift.protocol.TField("timeInterval", org.apache.thrift.protocol.TType.STRING, (short)3);
private static final org.apache.thrift.protocol.TField DURATION_FIELD_DESC = new org.apache.thrift.protocol.TField("duration", org.apache.thrift.protocol.TType.STRING, (short)4);
private static final org.apache.thrift.protocol.TField FILTER_QUERY_FIELD_DESC = new org.apache.thrift.protocol.TField("filterQuery", org.apache.thrift.protocol.TType.STRUCT, (short)5);
private static final org.apache.thrift.protocol.TField AGGREGATIONS_INFO_FIELD_DESC = new org.apache.thrift.protocol.TField("aggregationsInfo", org.apache.thrift.protocol.TType.LIST, (short)6);
private static final org.apache.thrift.protocol.TField GROUP_BY_FIELD_DESC = new org.apache.thrift.protocol.TField("groupBy", org.apache.thrift.protocol.TType.STRUCT, (short)7);
private static final org.apache.thrift.protocol.TField SELECTIONS_FIELD_DESC = new org.apache.thrift.protocol.TField("selections", org.apache.thrift.protocol.TType.STRUCT, (short)8);
private static final org.apache.thrift.protocol.TField FILTER_SUB_QUERY_MAP_FIELD_DESC = new org.apache.thrift.protocol.TField("filterSubQueryMap", org.apache.thrift.protocol.TType.STRUCT, (short)9);
private static final org.apache.thrift.protocol.TField BUCKET_HASH_KEY_FIELD_DESC = new org.apache.thrift.protocol.TField("bucketHashKey", org.apache.thrift.protocol.TType.STRING, (short)10);
private static final org.apache.thrift.protocol.TField ENABLE_TRACE_FIELD_DESC = new org.apache.thrift.protocol.TField("enableTrace", org.apache.thrift.protocol.TType.BOOL, (short)11);
private static final org.apache.thrift.protocol.TField RESPONSE_FORMAT_FIELD_DESC = new org.apache.thrift.protocol.TField("responseFormat", org.apache.thrift.protocol.TType.STRING, (short)12);
private static final org.apache.thrift.protocol.TField DEBUG_OPTIONS_FIELD_DESC = new org.apache.thrift.protocol.TField("debugOptions", org.apache.thrift.protocol.TType.MAP, (short)13);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new BrokerRequestStandardSchemeFactory());
schemes.put(TupleScheme.class, new BrokerRequestTupleSchemeFactory());
}
private QueryType queryType; // optional
private QuerySource querySource; // optional
private String timeInterval; // optional
private String duration; // optional
private FilterQuery filterQuery; // optional
private List<AggregationInfo> aggregationsInfo; // optional
private GroupBy groupBy; // optional
private Selection selections; // optional
private FilterQueryMap filterSubQueryMap; // optional
private String bucketHashKey; // optional
private boolean enableTrace; // optional
private String responseFormat; // optional
private Map<String,String> debugOptions; // 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 {
QUERY_TYPE((short)1, "queryType"),
QUERY_SOURCE((short)2, "querySource"),
TIME_INTERVAL((short)3, "timeInterval"),
DURATION((short)4, "duration"),
FILTER_QUERY((short)5, "filterQuery"),
AGGREGATIONS_INFO((short)6, "aggregationsInfo"),
GROUP_BY((short)7, "groupBy"),
SELECTIONS((short)8, "selections"),
FILTER_SUB_QUERY_MAP((short)9, "filterSubQueryMap"),
BUCKET_HASH_KEY((short)10, "bucketHashKey"),
ENABLE_TRACE((short)11, "enableTrace"),
RESPONSE_FORMAT((short)12, "responseFormat"),
DEBUG_OPTIONS((short)13, "debugOptions");
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: // QUERY_TYPE
return QUERY_TYPE;
case 2: // QUERY_SOURCE
return QUERY_SOURCE;
case 3: // TIME_INTERVAL
return TIME_INTERVAL;
case 4: // DURATION
return DURATION;
case 5: // FILTER_QUERY
return FILTER_QUERY;
case 6: // AGGREGATIONS_INFO
return AGGREGATIONS_INFO;
case 7: // GROUP_BY
return GROUP_BY;
case 8: // SELECTIONS
return SELECTIONS;
case 9: // FILTER_SUB_QUERY_MAP
return FILTER_SUB_QUERY_MAP;
case 10: // BUCKET_HASH_KEY
return BUCKET_HASH_KEY;
case 11: // ENABLE_TRACE
return ENABLE_TRACE;
case 12: // RESPONSE_FORMAT
return RESPONSE_FORMAT;
case 13: // DEBUG_OPTIONS
return DEBUG_OPTIONS;
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 __ENABLETRACE_ISSET_ID = 0;
private byte __isset_bitfield = 0;
private static final _Fields optionals[] = {_Fields.QUERY_TYPE,_Fields.QUERY_SOURCE,_Fields.TIME_INTERVAL,_Fields.DURATION,_Fields.FILTER_QUERY,_Fields.AGGREGATIONS_INFO,_Fields.GROUP_BY,_Fields.SELECTIONS,_Fields.FILTER_SUB_QUERY_MAP,_Fields.BUCKET_HASH_KEY,_Fields.ENABLE_TRACE,_Fields.RESPONSE_FORMAT,_Fields.DEBUG_OPTIONS};
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.QUERY_TYPE, new org.apache.thrift.meta_data.FieldMetaData("queryType", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, QueryType.class)));
tmpMap.put(_Fields.QUERY_SOURCE, new org.apache.thrift.meta_data.FieldMetaData("querySource", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, QuerySource.class)));
tmpMap.put(_Fields.TIME_INTERVAL, new org.apache.thrift.meta_data.FieldMetaData("timeInterval", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.DURATION, new org.apache.thrift.meta_data.FieldMetaData("duration", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.FILTER_QUERY, new org.apache.thrift.meta_data.FieldMetaData("filterQuery", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, FilterQuery.class)));
tmpMap.put(_Fields.AGGREGATIONS_INFO, new org.apache.thrift.meta_data.FieldMetaData("aggregationsInfo", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, AggregationInfo.class))));
tmpMap.put(_Fields.GROUP_BY, new org.apache.thrift.meta_data.FieldMetaData("groupBy", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, GroupBy.class)));
tmpMap.put(_Fields.SELECTIONS, new org.apache.thrift.meta_data.FieldMetaData("selections", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Selection.class)));
tmpMap.put(_Fields.FILTER_SUB_QUERY_MAP, new org.apache.thrift.meta_data.FieldMetaData("filterSubQueryMap", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, FilterQueryMap.class)));
tmpMap.put(_Fields.BUCKET_HASH_KEY, new org.apache.thrift.meta_data.FieldMetaData("bucketHashKey", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.ENABLE_TRACE, new org.apache.thrift.meta_data.FieldMetaData("enableTrace", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
tmpMap.put(_Fields.RESPONSE_FORMAT, new org.apache.thrift.meta_data.FieldMetaData("responseFormat", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.DEBUG_OPTIONS, new org.apache.thrift.meta_data.FieldMetaData("debugOptions", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING),
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(BrokerRequest.class, metaDataMap);
}
public BrokerRequest() {
}
/**
* Performs a deep copy on <i>other</i>.
*/
public BrokerRequest(BrokerRequest other) {
__isset_bitfield = other.__isset_bitfield;
if (other.isSetQueryType()) {
this.queryType = new QueryType(other.queryType);
}
if (other.isSetQuerySource()) {
this.querySource = new QuerySource(other.querySource);
}
if (other.isSetTimeInterval()) {
this.timeInterval = other.timeInterval;
}
if (other.isSetDuration()) {
this.duration = other.duration;
}
if (other.isSetFilterQuery()) {
this.filterQuery = new FilterQuery(other.filterQuery);
}
if (other.isSetAggregationsInfo()) {
List<AggregationInfo> __this__aggregationsInfo = new ArrayList<AggregationInfo>(other.aggregationsInfo.size());
for (AggregationInfo other_element : other.aggregationsInfo) {
__this__aggregationsInfo.add(new AggregationInfo(other_element));
}
this.aggregationsInfo = __this__aggregationsInfo;
}
if (other.isSetGroupBy()) {
this.groupBy = new GroupBy(other.groupBy);
}
if (other.isSetSelections()) {
this.selections = new Selection(other.selections);
}
if (other.isSetFilterSubQueryMap()) {
this.filterSubQueryMap = new FilterQueryMap(other.filterSubQueryMap);
}
if (other.isSetBucketHashKey()) {
this.bucketHashKey = other.bucketHashKey;
}
this.enableTrace = other.enableTrace;
if (other.isSetResponseFormat()) {
this.responseFormat = other.responseFormat;
}
if (other.isSetDebugOptions()) {
Map<String,String> __this__debugOptions = new HashMap<String,String>(other.debugOptions);
this.debugOptions = __this__debugOptions;
}
}
public BrokerRequest deepCopy() {
return new BrokerRequest(this);
}
@Override
public void clear() {
this.queryType = null;
this.querySource = null;
this.timeInterval = null;
this.duration = null;
this.filterQuery = null;
this.aggregationsInfo = null;
this.groupBy = null;
this.selections = null;
this.filterSubQueryMap = null;
this.bucketHashKey = null;
setEnableTraceIsSet(false);
this.enableTrace = false;
this.responseFormat = null;
this.debugOptions = null;
}
public QueryType getQueryType() {
return this.queryType;
}
public void setQueryType(QueryType queryType) {
this.queryType = queryType;
}
public void unsetQueryType() {
this.queryType = null;
}
/** Returns true if field queryType is set (has been assigned a value) and false otherwise */
public boolean isSetQueryType() {
return this.queryType != null;
}
public void setQueryTypeIsSet(boolean value) {
if (!value) {
this.queryType = null;
}
}
public QuerySource getQuerySource() {
return this.querySource;
}
public void setQuerySource(QuerySource querySource) {
this.querySource = querySource;
}
public void unsetQuerySource() {
this.querySource = null;
}
/** Returns true if field querySource is set (has been assigned a value) and false otherwise */
public boolean isSetQuerySource() {
return this.querySource != null;
}
public void setQuerySourceIsSet(boolean value) {
if (!value) {
this.querySource = null;
}
}
public String getTimeInterval() {
return this.timeInterval;
}
public void setTimeInterval(String timeInterval) {
this.timeInterval = timeInterval;
}
public void unsetTimeInterval() {
this.timeInterval = null;
}
/** Returns true if field timeInterval is set (has been assigned a value) and false otherwise */
public boolean isSetTimeInterval() {
return this.timeInterval != null;
}
public void setTimeIntervalIsSet(boolean value) {
if (!value) {
this.timeInterval = null;
}
}
public String getDuration() {
return this.duration;
}
public void setDuration(String duration) {
this.duration = duration;
}
public void unsetDuration() {
this.duration = null;
}
/** Returns true if field duration is set (has been assigned a value) and false otherwise */
public boolean isSetDuration() {
return this.duration != null;
}
public void setDurationIsSet(boolean value) {
if (!value) {
this.duration = null;
}
}
public FilterQuery getFilterQuery() {
return this.filterQuery;
}
public void setFilterQuery(FilterQuery filterQuery) {
this.filterQuery = filterQuery;
}
public void unsetFilterQuery() {
this.filterQuery = null;
}
/** Returns true if field filterQuery is set (has been assigned a value) and false otherwise */
public boolean isSetFilterQuery() {
return this.filterQuery != null;
}
public void setFilterQueryIsSet(boolean value) {
if (!value) {
this.filterQuery = null;
}
}
public int getAggregationsInfoSize() {
return (this.aggregationsInfo == null) ? 0 : this.aggregationsInfo.size();
}
public java.util.Iterator<AggregationInfo> getAggregationsInfoIterator() {
return (this.aggregationsInfo == null) ? null : this.aggregationsInfo.iterator();
}
public void addToAggregationsInfo(AggregationInfo elem) {
if (this.aggregationsInfo == null) {
this.aggregationsInfo = new ArrayList<AggregationInfo>();
}
this.aggregationsInfo.add(elem);
}
public List<AggregationInfo> getAggregationsInfo() {
return this.aggregationsInfo;
}
public void setAggregationsInfo(List<AggregationInfo> aggregationsInfo) {
this.aggregationsInfo = aggregationsInfo;
}
public void unsetAggregationsInfo() {
this.aggregationsInfo = null;
}
/** Returns true if field aggregationsInfo is set (has been assigned a value) and false otherwise */
public boolean isSetAggregationsInfo() {
return this.aggregationsInfo != null;
}
public void setAggregationsInfoIsSet(boolean value) {
if (!value) {
this.aggregationsInfo = null;
}
}
public GroupBy getGroupBy() {
return this.groupBy;
}
public void setGroupBy(GroupBy groupBy) {
this.groupBy = groupBy;
}
public void unsetGroupBy() {
this.groupBy = null;
}
/** Returns true if field groupBy is set (has been assigned a value) and false otherwise */
public boolean isSetGroupBy() {
return this.groupBy != null;
}
public void setGroupByIsSet(boolean value) {
if (!value) {
this.groupBy = null;
}
}
public Selection getSelections() {
return this.selections;
}
public void setSelections(Selection selections) {
this.selections = selections;
}
public void unsetSelections() {
this.selections = null;
}
/** Returns true if field selections is set (has been assigned a value) and false otherwise */
public boolean isSetSelections() {
return this.selections != null;
}
public void setSelectionsIsSet(boolean value) {
if (!value) {
this.selections = null;
}
}
public FilterQueryMap getFilterSubQueryMap() {
return this.filterSubQueryMap;
}
public void setFilterSubQueryMap(FilterQueryMap filterSubQueryMap) {
this.filterSubQueryMap = filterSubQueryMap;
}
public void unsetFilterSubQueryMap() {
this.filterSubQueryMap = null;
}
/** Returns true if field filterSubQueryMap is set (has been assigned a value) and false otherwise */
public boolean isSetFilterSubQueryMap() {
return this.filterSubQueryMap != null;
}
public void setFilterSubQueryMapIsSet(boolean value) {
if (!value) {
this.filterSubQueryMap = null;
}
}
public String getBucketHashKey() {
return this.bucketHashKey;
}
public void setBucketHashKey(String bucketHashKey) {
this.bucketHashKey = bucketHashKey;
}
public void unsetBucketHashKey() {
this.bucketHashKey = null;
}
/** Returns true if field bucketHashKey is set (has been assigned a value) and false otherwise */
public boolean isSetBucketHashKey() {
return this.bucketHashKey != null;
}
public void setBucketHashKeyIsSet(boolean value) {
if (!value) {
this.bucketHashKey = null;
}
}
public boolean isEnableTrace() {
return this.enableTrace;
}
public void setEnableTrace(boolean enableTrace) {
this.enableTrace = enableTrace;
setEnableTraceIsSet(true);
}
public void unsetEnableTrace() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ENABLETRACE_ISSET_ID);
}
/** Returns true if field enableTrace is set (has been assigned a value) and false otherwise */
public boolean isSetEnableTrace() {
return EncodingUtils.testBit(__isset_bitfield, __ENABLETRACE_ISSET_ID);
}
public void setEnableTraceIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ENABLETRACE_ISSET_ID, value);
}
public String getResponseFormat() {
return this.responseFormat;
}
public void setResponseFormat(String responseFormat) {
this.responseFormat = responseFormat;
}
public void unsetResponseFormat() {
this.responseFormat = null;
}
/** Returns true if field responseFormat is set (has been assigned a value) and false otherwise */
public boolean isSetResponseFormat() {
return this.responseFormat != null;
}
public void setResponseFormatIsSet(boolean value) {
if (!value) {
this.responseFormat = null;
}
}
public int getDebugOptionsSize() {
return (this.debugOptions == null) ? 0 : this.debugOptions.size();
}
public void putToDebugOptions(String key, String val) {
if (this.debugOptions == null) {
this.debugOptions = new HashMap<String,String>();
}
this.debugOptions.put(key, val);
}
public Map<String,String> getDebugOptions() {
return this.debugOptions;
}
public void setDebugOptions(Map<String,String> debugOptions) {
this.debugOptions = debugOptions;
}
public void unsetDebugOptions() {
this.debugOptions = null;
}
/** Returns true if field debugOptions is set (has been assigned a value) and false otherwise */
public boolean isSetDebugOptions() {
return this.debugOptions != null;
}
public void setDebugOptionsIsSet(boolean value) {
if (!value) {
this.debugOptions = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case QUERY_TYPE:
if (value == null) {
unsetQueryType();
} else {
setQueryType((QueryType)value);
}
break;
case QUERY_SOURCE:
if (value == null) {
unsetQuerySource();
} else {
setQuerySource((QuerySource)value);
}
break;
case TIME_INTERVAL:
if (value == null) {
unsetTimeInterval();
} else {
setTimeInterval((String)value);
}
break;
case DURATION:
if (value == null) {
unsetDuration();
} else {
setDuration((String)value);
}
break;
case FILTER_QUERY:
if (value == null) {
unsetFilterQuery();
} else {
setFilterQuery((FilterQuery)value);
}
break;
case AGGREGATIONS_INFO:
if (value == null) {
unsetAggregationsInfo();
} else {
setAggregationsInfo((List<AggregationInfo>)value);
}
break;
case GROUP_BY:
if (value == null) {
unsetGroupBy();
} else {
setGroupBy((GroupBy)value);
}
break;
case SELECTIONS:
if (value == null) {
unsetSelections();
} else {
setSelections((Selection)value);
}
break;
case FILTER_SUB_QUERY_MAP:
if (value == null) {
unsetFilterSubQueryMap();
} else {
setFilterSubQueryMap((FilterQueryMap)value);
}
break;
case BUCKET_HASH_KEY:
if (value == null) {
unsetBucketHashKey();
} else {
setBucketHashKey((String)value);
}
break;
case ENABLE_TRACE:
if (value == null) {
unsetEnableTrace();
} else {
setEnableTrace((Boolean)value);
}
break;
case RESPONSE_FORMAT:
if (value == null) {
unsetResponseFormat();
} else {
setResponseFormat((String)value);
}
break;
case DEBUG_OPTIONS:
if (value == null) {
unsetDebugOptions();
} else {
setDebugOptions((Map<String,String>)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case QUERY_TYPE:
return getQueryType();
case QUERY_SOURCE:
return getQuerySource();
case TIME_INTERVAL:
return getTimeInterval();
case DURATION:
return getDuration();
case FILTER_QUERY:
return getFilterQuery();
case AGGREGATIONS_INFO:
return getAggregationsInfo();
case GROUP_BY:
return getGroupBy();
case SELECTIONS:
return getSelections();
case FILTER_SUB_QUERY_MAP:
return getFilterSubQueryMap();
case BUCKET_HASH_KEY:
return getBucketHashKey();
case ENABLE_TRACE:
return Boolean.valueOf(isEnableTrace());
case RESPONSE_FORMAT:
return getResponseFormat();
case DEBUG_OPTIONS:
return getDebugOptions();
}
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 QUERY_TYPE:
return isSetQueryType();
case QUERY_SOURCE:
return isSetQuerySource();
case TIME_INTERVAL:
return isSetTimeInterval();
case DURATION:
return isSetDuration();
case FILTER_QUERY:
return isSetFilterQuery();
case AGGREGATIONS_INFO:
return isSetAggregationsInfo();
case GROUP_BY:
return isSetGroupBy();
case SELECTIONS:
return isSetSelections();
case FILTER_SUB_QUERY_MAP:
return isSetFilterSubQueryMap();
case BUCKET_HASH_KEY:
return isSetBucketHashKey();
case ENABLE_TRACE:
return isSetEnableTrace();
case RESPONSE_FORMAT:
return isSetResponseFormat();
case DEBUG_OPTIONS:
return isSetDebugOptions();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof BrokerRequest)
return this.equals((BrokerRequest)that);
return false;
}
public boolean equals(BrokerRequest that) {
if (that == null)
return false;
boolean this_present_queryType = true && this.isSetQueryType();
boolean that_present_queryType = true && that.isSetQueryType();
if (this_present_queryType || that_present_queryType) {
if (!(this_present_queryType && that_present_queryType))
return false;
if (!this.queryType.equals(that.queryType))
return false;
}
boolean this_present_querySource = true && this.isSetQuerySource();
boolean that_present_querySource = true && that.isSetQuerySource();
if (this_present_querySource || that_present_querySource) {
if (!(this_present_querySource && that_present_querySource))
return false;
if (!this.querySource.equals(that.querySource))
return false;
}
boolean this_present_timeInterval = true && this.isSetTimeInterval();
boolean that_present_timeInterval = true && that.isSetTimeInterval();
if (this_present_timeInterval || that_present_timeInterval) {
if (!(this_present_timeInterval && that_present_timeInterval))
return false;
if (!this.timeInterval.equals(that.timeInterval))
return false;
}
boolean this_present_duration = true && this.isSetDuration();
boolean that_present_duration = true && that.isSetDuration();
if (this_present_duration || that_present_duration) {
if (!(this_present_duration && that_present_duration))
return false;
if (!this.duration.equals(that.duration))
return false;
}
boolean this_present_filterQuery = true && this.isSetFilterQuery();
boolean that_present_filterQuery = true && that.isSetFilterQuery();
if (this_present_filterQuery || that_present_filterQuery) {
if (!(this_present_filterQuery && that_present_filterQuery))
return false;
if (!this.filterQuery.equals(that.filterQuery))
return false;
}
boolean this_present_aggregationsInfo = true && this.isSetAggregationsInfo();
boolean that_present_aggregationsInfo = true && that.isSetAggregationsInfo();
if (this_present_aggregationsInfo || that_present_aggregationsInfo) {
if (!(this_present_aggregationsInfo && that_present_aggregationsInfo))
return false;
if (!this.aggregationsInfo.equals(that.aggregationsInfo))
return false;
}
boolean this_present_groupBy = true && this.isSetGroupBy();
boolean that_present_groupBy = true && that.isSetGroupBy();
if (this_present_groupBy || that_present_groupBy) {
if (!(this_present_groupBy && that_present_groupBy))
return false;
if (!this.groupBy.equals(that.groupBy))
return false;
}
boolean this_present_selections = true && this.isSetSelections();
boolean that_present_selections = true && that.isSetSelections();
if (this_present_selections || that_present_selections) {
if (!(this_present_selections && that_present_selections))
return false;
if (!this.selections.equals(that.selections))
return false;
}
boolean this_present_filterSubQueryMap = true && this.isSetFilterSubQueryMap();
boolean that_present_filterSubQueryMap = true && that.isSetFilterSubQueryMap();
if (this_present_filterSubQueryMap || that_present_filterSubQueryMap) {
if (!(this_present_filterSubQueryMap && that_present_filterSubQueryMap))
return false;
if (!this.filterSubQueryMap.equals(that.filterSubQueryMap))
return false;
}
boolean this_present_bucketHashKey = true && this.isSetBucketHashKey();
boolean that_present_bucketHashKey = true && that.isSetBucketHashKey();
if (this_present_bucketHashKey || that_present_bucketHashKey) {
if (!(this_present_bucketHashKey && that_present_bucketHashKey))
return false;
if (!this.bucketHashKey.equals(that.bucketHashKey))
return false;
}
boolean this_present_enableTrace = true && this.isSetEnableTrace();
boolean that_present_enableTrace = true && that.isSetEnableTrace();
if (this_present_enableTrace || that_present_enableTrace) {
if (!(this_present_enableTrace && that_present_enableTrace))
return false;
if (this.enableTrace != that.enableTrace)
return false;
}
boolean this_present_responseFormat = true && this.isSetResponseFormat();
boolean that_present_responseFormat = true && that.isSetResponseFormat();
if (this_present_responseFormat || that_present_responseFormat) {
if (!(this_present_responseFormat && that_present_responseFormat))
return false;
if (!this.responseFormat.equals(that.responseFormat))
return false;
}
boolean this_present_debugOptions = true && this.isSetDebugOptions();
boolean that_present_debugOptions = true && that.isSetDebugOptions();
if (this_present_debugOptions || that_present_debugOptions) {
if (!(this_present_debugOptions && that_present_debugOptions))
return false;
if (!this.debugOptions.equals(that.debugOptions))
return false;
}
return true;
}
@Override
public int hashCode() {
List<Object> list = new ArrayList<Object>();
boolean present_queryType = true && (isSetQueryType());
list.add(present_queryType);
if (present_queryType)
list.add(queryType);
boolean present_querySource = true && (isSetQuerySource());
list.add(present_querySource);
if (present_querySource)
list.add(querySource);
boolean present_timeInterval = true && (isSetTimeInterval());
list.add(present_timeInterval);
if (present_timeInterval)
list.add(timeInterval);
boolean present_duration = true && (isSetDuration());
list.add(present_duration);
if (present_duration)
list.add(duration);
boolean present_filterQuery = true && (isSetFilterQuery());
list.add(present_filterQuery);
if (present_filterQuery)
list.add(filterQuery);
boolean present_aggregationsInfo = true && (isSetAggregationsInfo());
list.add(present_aggregationsInfo);
if (present_aggregationsInfo)
list.add(aggregationsInfo);
boolean present_groupBy = true && (isSetGroupBy());
list.add(present_groupBy);
if (present_groupBy)
list.add(groupBy);
boolean present_selections = true && (isSetSelections());
list.add(present_selections);
if (present_selections)
list.add(selections);
boolean present_filterSubQueryMap = true && (isSetFilterSubQueryMap());
list.add(present_filterSubQueryMap);
if (present_filterSubQueryMap)
list.add(filterSubQueryMap);
boolean present_bucketHashKey = true && (isSetBucketHashKey());
list.add(present_bucketHashKey);
if (present_bucketHashKey)
list.add(bucketHashKey);
boolean present_enableTrace = true && (isSetEnableTrace());
list.add(present_enableTrace);
if (present_enableTrace)
list.add(enableTrace);
boolean present_responseFormat = true && (isSetResponseFormat());
list.add(present_responseFormat);
if (present_responseFormat)
list.add(responseFormat);
boolean present_debugOptions = true && (isSetDebugOptions());
list.add(present_debugOptions);
if (present_debugOptions)
list.add(debugOptions);
return list.hashCode();
}
@Override
public int compareTo(BrokerRequest other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = Boolean.valueOf(isSetQueryType()).compareTo(other.isSetQueryType());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetQueryType()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.queryType, other.queryType);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetQuerySource()).compareTo(other.isSetQuerySource());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetQuerySource()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.querySource, other.querySource);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetTimeInterval()).compareTo(other.isSetTimeInterval());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetTimeInterval()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.timeInterval, other.timeInterval);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetDuration()).compareTo(other.isSetDuration());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetDuration()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.duration, other.duration);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetFilterQuery()).compareTo(other.isSetFilterQuery());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetFilterQuery()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.filterQuery, other.filterQuery);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetAggregationsInfo()).compareTo(other.isSetAggregationsInfo());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetAggregationsInfo()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.aggregationsInfo, other.aggregationsInfo);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetGroupBy()).compareTo(other.isSetGroupBy());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetGroupBy()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.groupBy, other.groupBy);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetSelections()).compareTo(other.isSetSelections());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetSelections()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.selections, other.selections);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetFilterSubQueryMap()).compareTo(other.isSetFilterSubQueryMap());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetFilterSubQueryMap()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.filterSubQueryMap, other.filterSubQueryMap);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetBucketHashKey()).compareTo(other.isSetBucketHashKey());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetBucketHashKey()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.bucketHashKey, other.bucketHashKey);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetEnableTrace()).compareTo(other.isSetEnableTrace());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetEnableTrace()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.enableTrace, other.enableTrace);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetResponseFormat()).compareTo(other.isSetResponseFormat());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetResponseFormat()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.responseFormat, other.responseFormat);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetDebugOptions()).compareTo(other.isSetDebugOptions());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetDebugOptions()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.debugOptions, other.debugOptions);
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("BrokerRequest(");
boolean first = true;
if (isSetQueryType()) {
sb.append("queryType:");
if (this.queryType == null) {
sb.append("null");
} else {
sb.append(this.queryType);
}
first = false;
}
if (isSetQuerySource()) {
if (!first) sb.append(", ");
sb.append("querySource:");
if (this.querySource == null) {
sb.append("null");
} else {
sb.append(this.querySource);
}
first = false;
}
if (isSetTimeInterval()) {
if (!first) sb.append(", ");
sb.append("timeInterval:");
if (this.timeInterval == null) {
sb.append("null");
} else {
sb.append(this.timeInterval);
}
first = false;
}
if (isSetDuration()) {
if (!first) sb.append(", ");
sb.append("duration:");
if (this.duration == null) {
sb.append("null");
} else {
sb.append(this.duration);
}
first = false;
}
if (isSetFilterQuery()) {
if (!first) sb.append(", ");
sb.append("filterQuery:");
if (this.filterQuery == null) {
sb.append("null");
} else {
sb.append(this.filterQuery);
}
first = false;
}
if (isSetAggregationsInfo()) {
if (!first) sb.append(", ");
sb.append("aggregationsInfo:");
if (this.aggregationsInfo == null) {
sb.append("null");
} else {
sb.append(this.aggregationsInfo);
}
first = false;
}
if (isSetGroupBy()) {
if (!first) sb.append(", ");
sb.append("groupBy:");
if (this.groupBy == null) {
sb.append("null");
} else {
sb.append(this.groupBy);
}
first = false;
}
if (isSetSelections()) {
if (!first) sb.append(", ");
sb.append("selections:");
if (this.selections == null) {
sb.append("null");
} else {
sb.append(this.selections);
}
first = false;
}
if (isSetFilterSubQueryMap()) {
if (!first) sb.append(", ");
sb.append("filterSubQueryMap:");
if (this.filterSubQueryMap == null) {
sb.append("null");
} else {
sb.append(this.filterSubQueryMap);
}
first = false;
}
if (isSetBucketHashKey()) {
if (!first) sb.append(", ");
sb.append("bucketHashKey:");
if (this.bucketHashKey == null) {
sb.append("null");
} else {
sb.append(this.bucketHashKey);
}
first = false;
}
if (isSetEnableTrace()) {
if (!first) sb.append(", ");
sb.append("enableTrace:");
sb.append(this.enableTrace);
first = false;
}
if (isSetResponseFormat()) {
if (!first) sb.append(", ");
sb.append("responseFormat:");
if (this.responseFormat == null) {
sb.append("null");
} else {
sb.append(this.responseFormat);
}
first = false;
}
if (isSetDebugOptions()) {
if (!first) sb.append(", ");
sb.append("debugOptions:");
if (this.debugOptions == null) {
sb.append("null");
} else {
sb.append(this.debugOptions);
}
first = false;
}
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
// check for sub-struct validity
if (queryType != null) {
queryType.validate();
}
if (querySource != null) {
querySource.validate();
}
if (filterQuery != null) {
filterQuery.validate();
}
if (groupBy != null) {
groupBy.validate();
}
if (selections != null) {
selections.validate();
}
if (filterSubQueryMap != null) {
filterSubQueryMap.validate();
}
}
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 BrokerRequestStandardSchemeFactory implements SchemeFactory {
public BrokerRequestStandardScheme getScheme() {
return new BrokerRequestStandardScheme();
}
}
private static class BrokerRequestStandardScheme extends StandardScheme<BrokerRequest> {
public void read(org.apache.thrift.protocol.TProtocol iprot, BrokerRequest 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: // QUERY_TYPE
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.queryType = new QueryType();
struct.queryType.read(iprot);
struct.setQueryTypeIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 2: // QUERY_SOURCE
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.querySource = new QuerySource();
struct.querySource.read(iprot);
struct.setQuerySourceIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 3: // TIME_INTERVAL
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.timeInterval = iprot.readString();
struct.setTimeIntervalIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 4: // DURATION
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.duration = iprot.readString();
struct.setDurationIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 5: // FILTER_QUERY
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.filterQuery = new FilterQuery();
struct.filterQuery.read(iprot);
struct.setFilterQueryIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 6: // AGGREGATIONS_INFO
if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
{
org.apache.thrift.protocol.TList _list68 = iprot.readListBegin();
struct.aggregationsInfo = new ArrayList<AggregationInfo>(_list68.size);
AggregationInfo _elem69;
for (int _i70 = 0; _i70 < _list68.size; ++_i70)
{
_elem69 = new AggregationInfo();
_elem69.read(iprot);
struct.aggregationsInfo.add(_elem69);
}
iprot.readListEnd();
}
struct.setAggregationsInfoIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 7: // GROUP_BY
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.groupBy = new GroupBy();
struct.groupBy.read(iprot);
struct.setGroupByIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 8: // SELECTIONS
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.selections = new Selection();
struct.selections.read(iprot);
struct.setSelectionsIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 9: // FILTER_SUB_QUERY_MAP
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.filterSubQueryMap = new FilterQueryMap();
struct.filterSubQueryMap.read(iprot);
struct.setFilterSubQueryMapIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 10: // BUCKET_HASH_KEY
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.bucketHashKey = iprot.readString();
struct.setBucketHashKeyIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 11: // ENABLE_TRACE
if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
struct.enableTrace = iprot.readBool();
struct.setEnableTraceIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 12: // RESPONSE_FORMAT
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.responseFormat = iprot.readString();
struct.setResponseFormatIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 13: // DEBUG_OPTIONS
if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
{
org.apache.thrift.protocol.TMap _map71 = iprot.readMapBegin();
struct.debugOptions = new HashMap<String,String>(2*_map71.size);
String _key72;
String _val73;
for (int _i74 = 0; _i74 < _map71.size; ++_i74)
{
_key72 = iprot.readString();
_val73 = iprot.readString();
struct.debugOptions.put(_key72, _val73);
}
iprot.readMapEnd();
}
struct.setDebugOptionsIsSet(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();
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, BrokerRequest struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.queryType != null) {
if (struct.isSetQueryType()) {
oprot.writeFieldBegin(QUERY_TYPE_FIELD_DESC);
struct.queryType.write(oprot);
oprot.writeFieldEnd();
}
}
if (struct.querySource != null) {
if (struct.isSetQuerySource()) {
oprot.writeFieldBegin(QUERY_SOURCE_FIELD_DESC);
struct.querySource.write(oprot);
oprot.writeFieldEnd();
}
}
if (struct.timeInterval != null) {
if (struct.isSetTimeInterval()) {
oprot.writeFieldBegin(TIME_INTERVAL_FIELD_DESC);
oprot.writeString(struct.timeInterval);
oprot.writeFieldEnd();
}
}
if (struct.duration != null) {
if (struct.isSetDuration()) {
oprot.writeFieldBegin(DURATION_FIELD_DESC);
oprot.writeString(struct.duration);
oprot.writeFieldEnd();
}
}
if (struct.filterQuery != null) {
if (struct.isSetFilterQuery()) {
oprot.writeFieldBegin(FILTER_QUERY_FIELD_DESC);
struct.filterQuery.write(oprot);
oprot.writeFieldEnd();
}
}
if (struct.aggregationsInfo != null) {
if (struct.isSetAggregationsInfo()) {
oprot.writeFieldBegin(AGGREGATIONS_INFO_FIELD_DESC);
{
oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.aggregationsInfo.size()));
for (AggregationInfo _iter75 : struct.aggregationsInfo)
{
_iter75.write(oprot);
}
oprot.writeListEnd();
}
oprot.writeFieldEnd();
}
}
if (struct.groupBy != null) {
if (struct.isSetGroupBy()) {
oprot.writeFieldBegin(GROUP_BY_FIELD_DESC);
struct.groupBy.write(oprot);
oprot.writeFieldEnd();
}
}
if (struct.selections != null) {
if (struct.isSetSelections()) {
oprot.writeFieldBegin(SELECTIONS_FIELD_DESC);
struct.selections.write(oprot);
oprot.writeFieldEnd();
}
}
if (struct.filterSubQueryMap != null) {
if (struct.isSetFilterSubQueryMap()) {
oprot.writeFieldBegin(FILTER_SUB_QUERY_MAP_FIELD_DESC);
struct.filterSubQueryMap.write(oprot);
oprot.writeFieldEnd();
}
}
if (struct.bucketHashKey != null) {
if (struct.isSetBucketHashKey()) {
oprot.writeFieldBegin(BUCKET_HASH_KEY_FIELD_DESC);
oprot.writeString(struct.bucketHashKey);
oprot.writeFieldEnd();
}
}
if (struct.isSetEnableTrace()) {
oprot.writeFieldBegin(ENABLE_TRACE_FIELD_DESC);
oprot.writeBool(struct.enableTrace);
oprot.writeFieldEnd();
}
if (struct.responseFormat != null) {
if (struct.isSetResponseFormat()) {
oprot.writeFieldBegin(RESPONSE_FORMAT_FIELD_DESC);
oprot.writeString(struct.responseFormat);
oprot.writeFieldEnd();
}
}
if (struct.debugOptions != null) {
if (struct.isSetDebugOptions()) {
oprot.writeFieldBegin(DEBUG_OPTIONS_FIELD_DESC);
{
oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.debugOptions.size()));
for (Map.Entry<String, String> _iter76 : struct.debugOptions.entrySet())
{
oprot.writeString(_iter76.getKey());
oprot.writeString(_iter76.getValue());
}
oprot.writeMapEnd();
}
oprot.writeFieldEnd();
}
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class BrokerRequestTupleSchemeFactory implements SchemeFactory {
public BrokerRequestTupleScheme getScheme() {
return new BrokerRequestTupleScheme();
}
}
private static class BrokerRequestTupleScheme extends TupleScheme<BrokerRequest> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, BrokerRequest struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetQueryType()) {
optionals.set(0);
}
if (struct.isSetQuerySource()) {
optionals.set(1);
}
if (struct.isSetTimeInterval()) {
optionals.set(2);
}
if (struct.isSetDuration()) {
optionals.set(3);
}
if (struct.isSetFilterQuery()) {
optionals.set(4);
}
if (struct.isSetAggregationsInfo()) {
optionals.set(5);
}
if (struct.isSetGroupBy()) {
optionals.set(6);
}
if (struct.isSetSelections()) {
optionals.set(7);
}
if (struct.isSetFilterSubQueryMap()) {
optionals.set(8);
}
if (struct.isSetBucketHashKey()) {
optionals.set(9);
}
if (struct.isSetEnableTrace()) {
optionals.set(10);
}
if (struct.isSetResponseFormat()) {
optionals.set(11);
}
if (struct.isSetDebugOptions()) {
optionals.set(12);
}
oprot.writeBitSet(optionals, 13);
if (struct.isSetQueryType()) {
struct.queryType.write(oprot);
}
if (struct.isSetQuerySource()) {
struct.querySource.write(oprot);
}
if (struct.isSetTimeInterval()) {
oprot.writeString(struct.timeInterval);
}
if (struct.isSetDuration()) {
oprot.writeString(struct.duration);
}
if (struct.isSetFilterQuery()) {
struct.filterQuery.write(oprot);
}
if (struct.isSetAggregationsInfo()) {
{
oprot.writeI32(struct.aggregationsInfo.size());
for (AggregationInfo _iter77 : struct.aggregationsInfo)
{
_iter77.write(oprot);
}
}
}
if (struct.isSetGroupBy()) {
struct.groupBy.write(oprot);
}
if (struct.isSetSelections()) {
struct.selections.write(oprot);
}
if (struct.isSetFilterSubQueryMap()) {
struct.filterSubQueryMap.write(oprot);
}
if (struct.isSetBucketHashKey()) {
oprot.writeString(struct.bucketHashKey);
}
if (struct.isSetEnableTrace()) {
oprot.writeBool(struct.enableTrace);
}
if (struct.isSetResponseFormat()) {
oprot.writeString(struct.responseFormat);
}
if (struct.isSetDebugOptions()) {
{
oprot.writeI32(struct.debugOptions.size());
for (Map.Entry<String, String> _iter78 : struct.debugOptions.entrySet())
{
oprot.writeString(_iter78.getKey());
oprot.writeString(_iter78.getValue());
}
}
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, BrokerRequest struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(13);
if (incoming.get(0)) {
struct.queryType = new QueryType();
struct.queryType.read(iprot);
struct.setQueryTypeIsSet(true);
}
if (incoming.get(1)) {
struct.querySource = new QuerySource();
struct.querySource.read(iprot);
struct.setQuerySourceIsSet(true);
}
if (incoming.get(2)) {
struct.timeInterval = iprot.readString();
struct.setTimeIntervalIsSet(true);
}
if (incoming.get(3)) {
struct.duration = iprot.readString();
struct.setDurationIsSet(true);
}
if (incoming.get(4)) {
struct.filterQuery = new FilterQuery();
struct.filterQuery.read(iprot);
struct.setFilterQueryIsSet(true);
}
if (incoming.get(5)) {
{
org.apache.thrift.protocol.TList _list79 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
struct.aggregationsInfo = new ArrayList<AggregationInfo>(_list79.size);
AggregationInfo _elem80;
for (int _i81 = 0; _i81 < _list79.size; ++_i81)
{
_elem80 = new AggregationInfo();
_elem80.read(iprot);
struct.aggregationsInfo.add(_elem80);
}
}
struct.setAggregationsInfoIsSet(true);
}
if (incoming.get(6)) {
struct.groupBy = new GroupBy();
struct.groupBy.read(iprot);
struct.setGroupByIsSet(true);
}
if (incoming.get(7)) {
struct.selections = new Selection();
struct.selections.read(iprot);
struct.setSelectionsIsSet(true);
}
if (incoming.get(8)) {
struct.filterSubQueryMap = new FilterQueryMap();
struct.filterSubQueryMap.read(iprot);
struct.setFilterSubQueryMapIsSet(true);
}
if (incoming.get(9)) {
struct.bucketHashKey = iprot.readString();
struct.setBucketHashKeyIsSet(true);
}
if (incoming.get(10)) {
struct.enableTrace = iprot.readBool();
struct.setEnableTraceIsSet(true);
}
if (incoming.get(11)) {
struct.responseFormat = iprot.readString();
struct.setResponseFormatIsSet(true);
}
if (incoming.get(12)) {
{
org.apache.thrift.protocol.TMap _map82 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32());
struct.debugOptions = new HashMap<String,String>(2*_map82.size);
String _key83;
String _val84;
for (int _i85 = 0; _i85 < _map82.size; ++_i85)
{
_key83 = iprot.readString();
_val84 = iprot.readString();
struct.debugOptions.put(_key83, _val84);
}
}
struct.setDebugOptionsIsSet(true);
}
}
}
}