http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/1e930bbc/interface/gen-java/org/apache/blur/thrift/generated/QueryArgs.java
----------------------------------------------------------------------
diff --git a/interface/gen-java/org/apache/blur/thrift/generated/QueryArgs.java b/interface/gen-java/org/apache/blur/thrift/generated/QueryArgs.java
new file mode 100644
index 0000000..92f8e68
--- /dev/null
+++ b/interface/gen-java/org/apache/blur/thrift/generated/QueryArgs.java
@@ -0,0 +1,1012 @@
+/**
+ * Autogenerated by Thrift Compiler (0.7.0)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ */
+package org.apache.blur.thrift.generated;
+
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+
+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 QueryArgs implements org.apache.thrift.TBase<QueryArgs, QueryArgs._Fields>, java.io.Serializable, Cloneable {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("QueryArgs");
+
+ private static final org.apache.thrift.protocol.TField AFTER_FIELD_DESC = new org.apache.thrift.protocol.TField("after", org.apache.thrift.protocol.TType.STRUCT, (short)1);
+ private static final org.apache.thrift.protocol.TField QUERY_FIELD_DESC = new org.apache.thrift.protocol.TField("query", org.apache.thrift.protocol.TType.STRING, (short)2);
+ private static final org.apache.thrift.protocol.TField FILTER_FIELD_DESC = new org.apache.thrift.protocol.TField("filter", org.apache.thrift.protocol.TType.STRING, (short)3);
+ private static final org.apache.thrift.protocol.TField NUMBER_TO_FETCH_FIELD_DESC = new org.apache.thrift.protocol.TField("numberToFetch", org.apache.thrift.protocol.TType.I32, (short)4);
+ private static final org.apache.thrift.protocol.TField SORT_FIELD_DESC = new org.apache.thrift.protocol.TField("sort", org.apache.thrift.protocol.TType.STRUCT, (short)5);
+ private static final org.apache.thrift.protocol.TField DO_DOC_SCORES_FIELD_DESC = new org.apache.thrift.protocol.TField("doDocScores", org.apache.thrift.protocol.TType.BOOL, (short)6);
+ private static final org.apache.thrift.protocol.TField DO_MAX_SCORE_FIELD_DESC = new org.apache.thrift.protocol.TField("doMaxScore", org.apache.thrift.protocol.TType.BOOL, (short)7);
+ private static final org.apache.thrift.protocol.TField SHARD_INDEXES_FIELD_DESC = new org.apache.thrift.protocol.TField("shardIndexes", org.apache.thrift.protocol.TType.LIST, (short)8);
+
+ public ScoreDoc after; // required
+ public ByteBuffer query; // required
+ public ByteBuffer filter; // required
+ public int numberToFetch; // required
+ public Sort sort; // required
+ public boolean doDocScores; // required
+ public boolean doMaxScore; // required
+ public List<Integer> shardIndexes; // 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 {
+ AFTER((short)1, "after"),
+ QUERY((short)2, "query"),
+ FILTER((short)3, "filter"),
+ NUMBER_TO_FETCH((short)4, "numberToFetch"),
+ SORT((short)5, "sort"),
+ DO_DOC_SCORES((short)6, "doDocScores"),
+ DO_MAX_SCORE((short)7, "doMaxScore"),
+ SHARD_INDEXES((short)8, "shardIndexes");
+
+ 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: // AFTER
+ return AFTER;
+ case 2: // QUERY
+ return QUERY;
+ case 3: // FILTER
+ return FILTER;
+ case 4: // NUMBER_TO_FETCH
+ return NUMBER_TO_FETCH;
+ case 5: // SORT
+ return SORT;
+ case 6: // DO_DOC_SCORES
+ return DO_DOC_SCORES;
+ case 7: // DO_MAX_SCORE
+ return DO_MAX_SCORE;
+ case 8: // SHARD_INDEXES
+ return SHARD_INDEXES;
+ 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 __NUMBERTOFETCH_ISSET_ID = 0;
+ private static final int __DODOCSCORES_ISSET_ID = 1;
+ private static final int __DOMAXSCORE_ISSET_ID = 2;
+ private BitSet __isset_bit_vector = new BitSet(3);
+
+ 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.AFTER, new org.apache.thrift.meta_data.FieldMetaData("after", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ScoreDoc.class)));
+ tmpMap.put(_Fields.QUERY, new org.apache.thrift.meta_data.FieldMetaData("query", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true)));
+ tmpMap.put(_Fields.FILTER, new org.apache.thrift.meta_data.FieldMetaData("filter", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true)));
+ tmpMap.put(_Fields.NUMBER_TO_FETCH, new org.apache.thrift.meta_data.FieldMetaData("numberToFetch", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
+ tmpMap.put(_Fields.SORT, new org.apache.thrift.meta_data.FieldMetaData("sort", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Sort.class)));
+ tmpMap.put(_Fields.DO_DOC_SCORES, new org.apache.thrift.meta_data.FieldMetaData("doDocScores", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
+ tmpMap.put(_Fields.DO_MAX_SCORE, new org.apache.thrift.meta_data.FieldMetaData("doMaxScore", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
+ tmpMap.put(_Fields.SHARD_INDEXES, new org.apache.thrift.meta_data.FieldMetaData("shardIndexes", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ 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.I32))));
+ metaDataMap = Collections.unmodifiableMap(tmpMap);
+ org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(QueryArgs.class, metaDataMap);
+ }
+
+ public QueryArgs() {
+ }
+
+ public QueryArgs(
+ ScoreDoc after,
+ ByteBuffer query,
+ ByteBuffer filter,
+ int numberToFetch,
+ Sort sort,
+ boolean doDocScores,
+ boolean doMaxScore,
+ List<Integer> shardIndexes)
+ {
+ this();
+ this.after = after;
+ this.query = query;
+ this.filter = filter;
+ this.numberToFetch = numberToFetch;
+ setNumberToFetchIsSet(true);
+ this.sort = sort;
+ this.doDocScores = doDocScores;
+ setDoDocScoresIsSet(true);
+ this.doMaxScore = doMaxScore;
+ setDoMaxScoreIsSet(true);
+ this.shardIndexes = shardIndexes;
+ }
+
+ /**
+ * Performs a deep copy on <i>other</i>.
+ */
+ public QueryArgs(QueryArgs other) {
+ __isset_bit_vector.clear();
+ __isset_bit_vector.or(other.__isset_bit_vector);
+ if (other.isSetAfter()) {
+ this.after = new ScoreDoc(other.after);
+ }
+ if (other.isSetQuery()) {
+ this.query = org.apache.thrift.TBaseHelper.copyBinary(other.query);
+;
+ }
+ if (other.isSetFilter()) {
+ this.filter = org.apache.thrift.TBaseHelper.copyBinary(other.filter);
+;
+ }
+ this.numberToFetch = other.numberToFetch;
+ if (other.isSetSort()) {
+ this.sort = new Sort(other.sort);
+ }
+ this.doDocScores = other.doDocScores;
+ this.doMaxScore = other.doMaxScore;
+ if (other.isSetShardIndexes()) {
+ List<Integer> __this__shardIndexes = new ArrayList<Integer>();
+ for (Integer other_element : other.shardIndexes) {
+ __this__shardIndexes.add(other_element);
+ }
+ this.shardIndexes = __this__shardIndexes;
+ }
+ }
+
+ public QueryArgs deepCopy() {
+ return new QueryArgs(this);
+ }
+
+ @Override
+ public void clear() {
+ this.after = null;
+ this.query = null;
+ this.filter = null;
+ setNumberToFetchIsSet(false);
+ this.numberToFetch = 0;
+ this.sort = null;
+ setDoDocScoresIsSet(false);
+ this.doDocScores = false;
+ setDoMaxScoreIsSet(false);
+ this.doMaxScore = false;
+ this.shardIndexes = null;
+ }
+
+ public ScoreDoc getAfter() {
+ return this.after;
+ }
+
+ public QueryArgs setAfter(ScoreDoc after) {
+ this.after = after;
+ return this;
+ }
+
+ public void unsetAfter() {
+ this.after = null;
+ }
+
+ /** Returns true if field after is set (has been assigned a value) and false otherwise */
+ public boolean isSetAfter() {
+ return this.after != null;
+ }
+
+ public void setAfterIsSet(boolean value) {
+ if (!value) {
+ this.after = null;
+ }
+ }
+
+ public byte[] getQuery() {
+ setQuery(org.apache.thrift.TBaseHelper.rightSize(query));
+ return query == null ? null : query.array();
+ }
+
+ public ByteBuffer bufferForQuery() {
+ return query;
+ }
+
+ public QueryArgs setQuery(byte[] query) {
+ setQuery(query == null ? (ByteBuffer)null : ByteBuffer.wrap(query));
+ return this;
+ }
+
+ public QueryArgs setQuery(ByteBuffer query) {
+ this.query = query;
+ return this;
+ }
+
+ public void unsetQuery() {
+ this.query = null;
+ }
+
+ /** Returns true if field query is set (has been assigned a value) and false otherwise */
+ public boolean isSetQuery() {
+ return this.query != null;
+ }
+
+ public void setQueryIsSet(boolean value) {
+ if (!value) {
+ this.query = null;
+ }
+ }
+
+ public byte[] getFilter() {
+ setFilter(org.apache.thrift.TBaseHelper.rightSize(filter));
+ return filter == null ? null : filter.array();
+ }
+
+ public ByteBuffer bufferForFilter() {
+ return filter;
+ }
+
+ public QueryArgs setFilter(byte[] filter) {
+ setFilter(filter == null ? (ByteBuffer)null : ByteBuffer.wrap(filter));
+ return this;
+ }
+
+ public QueryArgs setFilter(ByteBuffer filter) {
+ this.filter = filter;
+ return this;
+ }
+
+ public void unsetFilter() {
+ this.filter = null;
+ }
+
+ /** Returns true if field filter is set (has been assigned a value) and false otherwise */
+ public boolean isSetFilter() {
+ return this.filter != null;
+ }
+
+ public void setFilterIsSet(boolean value) {
+ if (!value) {
+ this.filter = null;
+ }
+ }
+
+ public int getNumberToFetch() {
+ return this.numberToFetch;
+ }
+
+ public QueryArgs setNumberToFetch(int numberToFetch) {
+ this.numberToFetch = numberToFetch;
+ setNumberToFetchIsSet(true);
+ return this;
+ }
+
+ public void unsetNumberToFetch() {
+ __isset_bit_vector.clear(__NUMBERTOFETCH_ISSET_ID);
+ }
+
+ /** Returns true if field numberToFetch is set (has been assigned a value) and false otherwise */
+ public boolean isSetNumberToFetch() {
+ return __isset_bit_vector.get(__NUMBERTOFETCH_ISSET_ID);
+ }
+
+ public void setNumberToFetchIsSet(boolean value) {
+ __isset_bit_vector.set(__NUMBERTOFETCH_ISSET_ID, value);
+ }
+
+ public Sort getSort() {
+ return this.sort;
+ }
+
+ public QueryArgs setSort(Sort sort) {
+ this.sort = sort;
+ return this;
+ }
+
+ public void unsetSort() {
+ this.sort = null;
+ }
+
+ /** Returns true if field sort is set (has been assigned a value) and false otherwise */
+ public boolean isSetSort() {
+ return this.sort != null;
+ }
+
+ public void setSortIsSet(boolean value) {
+ if (!value) {
+ this.sort = null;
+ }
+ }
+
+ public boolean isDoDocScores() {
+ return this.doDocScores;
+ }
+
+ public QueryArgs setDoDocScores(boolean doDocScores) {
+ this.doDocScores = doDocScores;
+ setDoDocScoresIsSet(true);
+ return this;
+ }
+
+ public void unsetDoDocScores() {
+ __isset_bit_vector.clear(__DODOCSCORES_ISSET_ID);
+ }
+
+ /** Returns true if field doDocScores is set (has been assigned a value) and false otherwise */
+ public boolean isSetDoDocScores() {
+ return __isset_bit_vector.get(__DODOCSCORES_ISSET_ID);
+ }
+
+ public void setDoDocScoresIsSet(boolean value) {
+ __isset_bit_vector.set(__DODOCSCORES_ISSET_ID, value);
+ }
+
+ public boolean isDoMaxScore() {
+ return this.doMaxScore;
+ }
+
+ public QueryArgs setDoMaxScore(boolean doMaxScore) {
+ this.doMaxScore = doMaxScore;
+ setDoMaxScoreIsSet(true);
+ return this;
+ }
+
+ public void unsetDoMaxScore() {
+ __isset_bit_vector.clear(__DOMAXSCORE_ISSET_ID);
+ }
+
+ /** Returns true if field doMaxScore is set (has been assigned a value) and false otherwise */
+ public boolean isSetDoMaxScore() {
+ return __isset_bit_vector.get(__DOMAXSCORE_ISSET_ID);
+ }
+
+ public void setDoMaxScoreIsSet(boolean value) {
+ __isset_bit_vector.set(__DOMAXSCORE_ISSET_ID, value);
+ }
+
+ public int getShardIndexesSize() {
+ return (this.shardIndexes == null) ? 0 : this.shardIndexes.size();
+ }
+
+ public java.util.Iterator<Integer> getShardIndexesIterator() {
+ return (this.shardIndexes == null) ? null : this.shardIndexes.iterator();
+ }
+
+ public void addToShardIndexes(int elem) {
+ if (this.shardIndexes == null) {
+ this.shardIndexes = new ArrayList<Integer>();
+ }
+ this.shardIndexes.add(elem);
+ }
+
+ public List<Integer> getShardIndexes() {
+ return this.shardIndexes;
+ }
+
+ public QueryArgs setShardIndexes(List<Integer> shardIndexes) {
+ this.shardIndexes = shardIndexes;
+ return this;
+ }
+
+ public void unsetShardIndexes() {
+ this.shardIndexes = null;
+ }
+
+ /** Returns true if field shardIndexes is set (has been assigned a value) and false otherwise */
+ public boolean isSetShardIndexes() {
+ return this.shardIndexes != null;
+ }
+
+ public void setShardIndexesIsSet(boolean value) {
+ if (!value) {
+ this.shardIndexes = null;
+ }
+ }
+
+ public void setFieldValue(_Fields field, Object value) {
+ switch (field) {
+ case AFTER:
+ if (value == null) {
+ unsetAfter();
+ } else {
+ setAfter((ScoreDoc)value);
+ }
+ break;
+
+ case QUERY:
+ if (value == null) {
+ unsetQuery();
+ } else {
+ setQuery((ByteBuffer)value);
+ }
+ break;
+
+ case FILTER:
+ if (value == null) {
+ unsetFilter();
+ } else {
+ setFilter((ByteBuffer)value);
+ }
+ break;
+
+ case NUMBER_TO_FETCH:
+ if (value == null) {
+ unsetNumberToFetch();
+ } else {
+ setNumberToFetch((Integer)value);
+ }
+ break;
+
+ case SORT:
+ if (value == null) {
+ unsetSort();
+ } else {
+ setSort((Sort)value);
+ }
+ break;
+
+ case DO_DOC_SCORES:
+ if (value == null) {
+ unsetDoDocScores();
+ } else {
+ setDoDocScores((Boolean)value);
+ }
+ break;
+
+ case DO_MAX_SCORE:
+ if (value == null) {
+ unsetDoMaxScore();
+ } else {
+ setDoMaxScore((Boolean)value);
+ }
+ break;
+
+ case SHARD_INDEXES:
+ if (value == null) {
+ unsetShardIndexes();
+ } else {
+ setShardIndexes((List<Integer>)value);
+ }
+ break;
+
+ }
+ }
+
+ public Object getFieldValue(_Fields field) {
+ switch (field) {
+ case AFTER:
+ return getAfter();
+
+ case QUERY:
+ return getQuery();
+
+ case FILTER:
+ return getFilter();
+
+ case NUMBER_TO_FETCH:
+ return Integer.valueOf(getNumberToFetch());
+
+ case SORT:
+ return getSort();
+
+ case DO_DOC_SCORES:
+ return Boolean.valueOf(isDoDocScores());
+
+ case DO_MAX_SCORE:
+ return Boolean.valueOf(isDoMaxScore());
+
+ case SHARD_INDEXES:
+ return getShardIndexes();
+
+ }
+ 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 AFTER:
+ return isSetAfter();
+ case QUERY:
+ return isSetQuery();
+ case FILTER:
+ return isSetFilter();
+ case NUMBER_TO_FETCH:
+ return isSetNumberToFetch();
+ case SORT:
+ return isSetSort();
+ case DO_DOC_SCORES:
+ return isSetDoDocScores();
+ case DO_MAX_SCORE:
+ return isSetDoMaxScore();
+ case SHARD_INDEXES:
+ return isSetShardIndexes();
+ }
+ throw new IllegalStateException();
+ }
+
+ @Override
+ public boolean equals(Object that) {
+ if (that == null)
+ return false;
+ if (that instanceof QueryArgs)
+ return this.equals((QueryArgs)that);
+ return false;
+ }
+
+ public boolean equals(QueryArgs that) {
+ if (that == null)
+ return false;
+
+ boolean this_present_after = true && this.isSetAfter();
+ boolean that_present_after = true && that.isSetAfter();
+ if (this_present_after || that_present_after) {
+ if (!(this_present_after && that_present_after))
+ return false;
+ if (!this.after.equals(that.after))
+ return false;
+ }
+
+ boolean this_present_query = true && this.isSetQuery();
+ boolean that_present_query = true && that.isSetQuery();
+ if (this_present_query || that_present_query) {
+ if (!(this_present_query && that_present_query))
+ return false;
+ if (!this.query.equals(that.query))
+ return false;
+ }
+
+ boolean this_present_filter = true && this.isSetFilter();
+ boolean that_present_filter = true && that.isSetFilter();
+ if (this_present_filter || that_present_filter) {
+ if (!(this_present_filter && that_present_filter))
+ return false;
+ if (!this.filter.equals(that.filter))
+ return false;
+ }
+
+ boolean this_present_numberToFetch = true;
+ boolean that_present_numberToFetch = true;
+ if (this_present_numberToFetch || that_present_numberToFetch) {
+ if (!(this_present_numberToFetch && that_present_numberToFetch))
+ return false;
+ if (this.numberToFetch != that.numberToFetch)
+ return false;
+ }
+
+ boolean this_present_sort = true && this.isSetSort();
+ boolean that_present_sort = true && that.isSetSort();
+ if (this_present_sort || that_present_sort) {
+ if (!(this_present_sort && that_present_sort))
+ return false;
+ if (!this.sort.equals(that.sort))
+ return false;
+ }
+
+ boolean this_present_doDocScores = true;
+ boolean that_present_doDocScores = true;
+ if (this_present_doDocScores || that_present_doDocScores) {
+ if (!(this_present_doDocScores && that_present_doDocScores))
+ return false;
+ if (this.doDocScores != that.doDocScores)
+ return false;
+ }
+
+ boolean this_present_doMaxScore = true;
+ boolean that_present_doMaxScore = true;
+ if (this_present_doMaxScore || that_present_doMaxScore) {
+ if (!(this_present_doMaxScore && that_present_doMaxScore))
+ return false;
+ if (this.doMaxScore != that.doMaxScore)
+ return false;
+ }
+
+ boolean this_present_shardIndexes = true && this.isSetShardIndexes();
+ boolean that_present_shardIndexes = true && that.isSetShardIndexes();
+ if (this_present_shardIndexes || that_present_shardIndexes) {
+ if (!(this_present_shardIndexes && that_present_shardIndexes))
+ return false;
+ if (!this.shardIndexes.equals(that.shardIndexes))
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ return 0;
+ }
+
+ public int compareTo(QueryArgs other) {
+ if (!getClass().equals(other.getClass())) {
+ return getClass().getName().compareTo(other.getClass().getName());
+ }
+
+ int lastComparison = 0;
+ QueryArgs typedOther = (QueryArgs)other;
+
+ lastComparison = Boolean.valueOf(isSetAfter()).compareTo(typedOther.isSetAfter());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetAfter()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.after, typedOther.after);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetQuery()).compareTo(typedOther.isSetQuery());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetQuery()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.query, typedOther.query);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetFilter()).compareTo(typedOther.isSetFilter());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetFilter()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.filter, typedOther.filter);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetNumberToFetch()).compareTo(typedOther.isSetNumberToFetch());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetNumberToFetch()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.numberToFetch, typedOther.numberToFetch);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetSort()).compareTo(typedOther.isSetSort());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetSort()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sort, typedOther.sort);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetDoDocScores()).compareTo(typedOther.isSetDoDocScores());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetDoDocScores()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.doDocScores, typedOther.doDocScores);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetDoMaxScore()).compareTo(typedOther.isSetDoMaxScore());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetDoMaxScore()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.doMaxScore, typedOther.doMaxScore);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetShardIndexes()).compareTo(typedOther.isSetShardIndexes());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetShardIndexes()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.shardIndexes, typedOther.shardIndexes);
+ 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: // AFTER
+ if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
+ this.after = new ScoreDoc();
+ this.after.read(iprot);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
+ }
+ break;
+ case 2: // QUERY
+ if (field.type == org.apache.thrift.protocol.TType.STRING) {
+ this.query = iprot.readBinary();
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
+ }
+ break;
+ case 3: // FILTER
+ if (field.type == org.apache.thrift.protocol.TType.STRING) {
+ this.filter = iprot.readBinary();
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
+ }
+ break;
+ case 4: // NUMBER_TO_FETCH
+ if (field.type == org.apache.thrift.protocol.TType.I32) {
+ this.numberToFetch = iprot.readI32();
+ setNumberToFetchIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
+ }
+ break;
+ case 5: // SORT
+ if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
+ this.sort = new Sort();
+ this.sort.read(iprot);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
+ }
+ break;
+ case 6: // DO_DOC_SCORES
+ if (field.type == org.apache.thrift.protocol.TType.BOOL) {
+ this.doDocScores = iprot.readBool();
+ setDoDocScoresIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
+ }
+ break;
+ case 7: // DO_MAX_SCORE
+ if (field.type == org.apache.thrift.protocol.TType.BOOL) {
+ this.doMaxScore = iprot.readBool();
+ setDoMaxScoreIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
+ }
+ break;
+ case 8: // SHARD_INDEXES
+ if (field.type == org.apache.thrift.protocol.TType.LIST) {
+ {
+ org.apache.thrift.protocol.TList _list96 = iprot.readListBegin();
+ this.shardIndexes = new ArrayList<Integer>(_list96.size);
+ for (int _i97 = 0; _i97 < _list96.size; ++_i97)
+ {
+ int _elem98; // required
+ _elem98 = iprot.readI32();
+ this.shardIndexes.add(_elem98);
+ }
+ iprot.readListEnd();
+ }
+ } 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.after != null) {
+ oprot.writeFieldBegin(AFTER_FIELD_DESC);
+ this.after.write(oprot);
+ oprot.writeFieldEnd();
+ }
+ if (this.query != null) {
+ oprot.writeFieldBegin(QUERY_FIELD_DESC);
+ oprot.writeBinary(this.query);
+ oprot.writeFieldEnd();
+ }
+ if (this.filter != null) {
+ oprot.writeFieldBegin(FILTER_FIELD_DESC);
+ oprot.writeBinary(this.filter);
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldBegin(NUMBER_TO_FETCH_FIELD_DESC);
+ oprot.writeI32(this.numberToFetch);
+ oprot.writeFieldEnd();
+ if (this.sort != null) {
+ oprot.writeFieldBegin(SORT_FIELD_DESC);
+ this.sort.write(oprot);
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldBegin(DO_DOC_SCORES_FIELD_DESC);
+ oprot.writeBool(this.doDocScores);
+ oprot.writeFieldEnd();
+ oprot.writeFieldBegin(DO_MAX_SCORE_FIELD_DESC);
+ oprot.writeBool(this.doMaxScore);
+ oprot.writeFieldEnd();
+ if (this.shardIndexes != null) {
+ oprot.writeFieldBegin(SHARD_INDEXES_FIELD_DESC);
+ {
+ oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I32, this.shardIndexes.size()));
+ for (int _iter99 : this.shardIndexes)
+ {
+ oprot.writeI32(_iter99);
+ }
+ oprot.writeListEnd();
+ }
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder("QueryArgs(");
+ boolean first = true;
+
+ sb.append("after:");
+ if (this.after == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.after);
+ }
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("query:");
+ if (this.query == null) {
+ sb.append("null");
+ } else {
+ org.apache.thrift.TBaseHelper.toString(this.query, sb);
+ }
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("filter:");
+ if (this.filter == null) {
+ sb.append("null");
+ } else {
+ org.apache.thrift.TBaseHelper.toString(this.filter, sb);
+ }
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("numberToFetch:");
+ sb.append(this.numberToFetch);
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("sort:");
+ if (this.sort == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.sort);
+ }
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("doDocScores:");
+ sb.append(this.doDocScores);
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("doMaxScore:");
+ sb.append(this.doMaxScore);
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("shardIndexes:");
+ if (this.shardIndexes == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.shardIndexes);
+ }
+ first = false;
+ sb.append(")");
+ return sb.toString();
+ }
+
+ public void validate() throws org.apache.thrift.TException {
+ // check for required fields
+ }
+
+ 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);
+ }
+ }
+
+}
+
http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/1e930bbc/interface/gen-java/org/apache/blur/thrift/generated/QuerySession.java
----------------------------------------------------------------------
diff --git a/interface/gen-java/org/apache/blur/thrift/generated/QuerySession.java b/interface/gen-java/org/apache/blur/thrift/generated/QuerySession.java
new file mode 100644
index 0000000..75e8ab9
--- /dev/null
+++ b/interface/gen-java/org/apache/blur/thrift/generated/QuerySession.java
@@ -0,0 +1,428 @@
+/**
+ * Autogenerated by Thrift Compiler (0.7.0)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ */
+package org.apache.blur.thrift.generated;
+
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+
+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 QuerySession implements org.apache.thrift.TBase<QuerySession, QuerySession._Fields>, java.io.Serializable, Cloneable {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("QuerySession");
+
+ private static final org.apache.thrift.protocol.TField SESSION_FIELD_DESC = new org.apache.thrift.protocol.TField("session", org.apache.thrift.protocol.TType.STRUCT, (short)1);
+ private static final org.apache.thrift.protocol.TField QUERY_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("queryId", org.apache.thrift.protocol.TType.STRING, (short)2);
+
+ public Session session; // required
+ public String queryId; // 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 {
+ SESSION((short)1, "session"),
+ QUERY_ID((short)2, "queryId");
+
+ 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: // SESSION
+ return SESSION;
+ case 2: // QUERY_ID
+ return QUERY_ID;
+ default:
+ return null;
+ }
+ }
+
+ /**
+ * Find the _Fields constant that matches fieldId, throwing an exception
+ * if it is not found.
+ */
+ public static _Fields findByThriftIdOrThrow(int fieldId) {
+ _Fields fields = findByThriftId(fieldId);
+ if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+ return fields;
+ }
+
+ /**
+ * Find the _Fields constant that matches name, or null if its not found.
+ */
+ public static _Fields findByName(String name) {
+ return byName.get(name);
+ }
+
+ private final short _thriftId;
+ private final String _fieldName;
+
+ _Fields(short thriftId, String fieldName) {
+ _thriftId = thriftId;
+ _fieldName = fieldName;
+ }
+
+ public short getThriftFieldId() {
+ return _thriftId;
+ }
+
+ public String getFieldName() {
+ return _fieldName;
+ }
+ }
+
+ // isset id assignments
+
+ 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.SESSION, new org.apache.thrift.meta_data.FieldMetaData("session", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Session.class)));
+ tmpMap.put(_Fields.QUERY_ID, new org.apache.thrift.meta_data.FieldMetaData("queryId", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+ metaDataMap = Collections.unmodifiableMap(tmpMap);
+ org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(QuerySession.class, metaDataMap);
+ }
+
+ public QuerySession() {
+ }
+
+ public QuerySession(
+ Session session,
+ String queryId)
+ {
+ this();
+ this.session = session;
+ this.queryId = queryId;
+ }
+
+ /**
+ * Performs a deep copy on <i>other</i>.
+ */
+ public QuerySession(QuerySession other) {
+ if (other.isSetSession()) {
+ this.session = new Session(other.session);
+ }
+ if (other.isSetQueryId()) {
+ this.queryId = other.queryId;
+ }
+ }
+
+ public QuerySession deepCopy() {
+ return new QuerySession(this);
+ }
+
+ @Override
+ public void clear() {
+ this.session = null;
+ this.queryId = null;
+ }
+
+ public Session getSession() {
+ return this.session;
+ }
+
+ public QuerySession setSession(Session session) {
+ this.session = session;
+ return this;
+ }
+
+ public void unsetSession() {
+ this.session = null;
+ }
+
+ /** Returns true if field session is set (has been assigned a value) and false otherwise */
+ public boolean isSetSession() {
+ return this.session != null;
+ }
+
+ public void setSessionIsSet(boolean value) {
+ if (!value) {
+ this.session = null;
+ }
+ }
+
+ public String getQueryId() {
+ return this.queryId;
+ }
+
+ public QuerySession setQueryId(String queryId) {
+ this.queryId = queryId;
+ return this;
+ }
+
+ public void unsetQueryId() {
+ this.queryId = null;
+ }
+
+ /** Returns true if field queryId is set (has been assigned a value) and false otherwise */
+ public boolean isSetQueryId() {
+ return this.queryId != null;
+ }
+
+ public void setQueryIdIsSet(boolean value) {
+ if (!value) {
+ this.queryId = null;
+ }
+ }
+
+ public void setFieldValue(_Fields field, Object value) {
+ switch (field) {
+ case SESSION:
+ if (value == null) {
+ unsetSession();
+ } else {
+ setSession((Session)value);
+ }
+ break;
+
+ case QUERY_ID:
+ if (value == null) {
+ unsetQueryId();
+ } else {
+ setQueryId((String)value);
+ }
+ break;
+
+ }
+ }
+
+ public Object getFieldValue(_Fields field) {
+ switch (field) {
+ case SESSION:
+ return getSession();
+
+ case QUERY_ID:
+ return getQueryId();
+
+ }
+ 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 SESSION:
+ return isSetSession();
+ case QUERY_ID:
+ return isSetQueryId();
+ }
+ throw new IllegalStateException();
+ }
+
+ @Override
+ public boolean equals(Object that) {
+ if (that == null)
+ return false;
+ if (that instanceof QuerySession)
+ return this.equals((QuerySession)that);
+ return false;
+ }
+
+ public boolean equals(QuerySession that) {
+ if (that == null)
+ return false;
+
+ boolean this_present_session = true && this.isSetSession();
+ boolean that_present_session = true && that.isSetSession();
+ if (this_present_session || that_present_session) {
+ if (!(this_present_session && that_present_session))
+ return false;
+ if (!this.session.equals(that.session))
+ return false;
+ }
+
+ boolean this_present_queryId = true && this.isSetQueryId();
+ boolean that_present_queryId = true && that.isSetQueryId();
+ if (this_present_queryId || that_present_queryId) {
+ if (!(this_present_queryId && that_present_queryId))
+ return false;
+ if (!this.queryId.equals(that.queryId))
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ return 0;
+ }
+
+ public int compareTo(QuerySession other) {
+ if (!getClass().equals(other.getClass())) {
+ return getClass().getName().compareTo(other.getClass().getName());
+ }
+
+ int lastComparison = 0;
+ QuerySession typedOther = (QuerySession)other;
+
+ lastComparison = Boolean.valueOf(isSetSession()).compareTo(typedOther.isSetSession());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetSession()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.session, typedOther.session);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetQueryId()).compareTo(typedOther.isSetQueryId());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetQueryId()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.queryId, typedOther.queryId);
+ 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: // SESSION
+ if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
+ this.session = new Session();
+ this.session.read(iprot);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
+ }
+ break;
+ case 2: // QUERY_ID
+ if (field.type == org.apache.thrift.protocol.TType.STRING) {
+ this.queryId = iprot.readString();
+ } 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.session != null) {
+ oprot.writeFieldBegin(SESSION_FIELD_DESC);
+ this.session.write(oprot);
+ oprot.writeFieldEnd();
+ }
+ if (this.queryId != null) {
+ oprot.writeFieldBegin(QUERY_ID_FIELD_DESC);
+ oprot.writeString(this.queryId);
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder("QuerySession(");
+ boolean first = true;
+
+ sb.append("session:");
+ if (this.session == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.session);
+ }
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("queryId:");
+ if (this.queryId == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.queryId);
+ }
+ first = false;
+ sb.append(")");
+ return sb.toString();
+ }
+
+ public void validate() throws org.apache.thrift.TException {
+ // check for required fields
+ }
+
+ 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 {
+ 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);
+ }
+ }
+
+}
+
http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/1e930bbc/interface/gen-java/org/apache/blur/thrift/generated/ScoreDoc.java
----------------------------------------------------------------------
diff --git a/interface/gen-java/org/apache/blur/thrift/generated/ScoreDoc.java b/interface/gen-java/org/apache/blur/thrift/generated/ScoreDoc.java
new file mode 100644
index 0000000..4bb7e15
--- /dev/null
+++ b/interface/gen-java/org/apache/blur/thrift/generated/ScoreDoc.java
@@ -0,0 +1,556 @@
+/**
+ * Autogenerated by Thrift Compiler (0.7.0)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ */
+package org.apache.blur.thrift.generated;
+
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+
+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 ScoreDoc implements org.apache.thrift.TBase<ScoreDoc, ScoreDoc._Fields>, java.io.Serializable, Cloneable {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ScoreDoc");
+
+ private static final org.apache.thrift.protocol.TField SCORE_FIELD_DESC = new org.apache.thrift.protocol.TField("score", org.apache.thrift.protocol.TType.DOUBLE, (short)1);
+ private static final org.apache.thrift.protocol.TField DOC_LOCATION_FIELD_DESC = new org.apache.thrift.protocol.TField("docLocation", org.apache.thrift.protocol.TType.STRUCT, (short)2);
+ private static final org.apache.thrift.protocol.TField FIELDS_FIELD_DESC = new org.apache.thrift.protocol.TField("fields", org.apache.thrift.protocol.TType.LIST, (short)4);
+
+ public double score; // required
+ public DocLocation docLocation; // required
+ public List<ByteBuffer> fields; // 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 {
+ SCORE((short)1, "score"),
+ DOC_LOCATION((short)2, "docLocation"),
+ FIELDS((short)4, "fields");
+
+ 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: // SCORE
+ return SCORE;
+ case 2: // DOC_LOCATION
+ return DOC_LOCATION;
+ case 4: // FIELDS
+ return FIELDS;
+ 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 __SCORE_ISSET_ID = 0;
+ private BitSet __isset_bit_vector = new BitSet(1);
+
+ public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
+ static {
+ Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
+ tmpMap.put(_Fields.SCORE, new org.apache.thrift.meta_data.FieldMetaData("score", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
+ tmpMap.put(_Fields.DOC_LOCATION, new org.apache.thrift.meta_data.FieldMetaData("docLocation", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, DocLocation.class)));
+ tmpMap.put(_Fields.FIELDS, new org.apache.thrift.meta_data.FieldMetaData("fields", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ 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 , true))));
+ metaDataMap = Collections.unmodifiableMap(tmpMap);
+ org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ScoreDoc.class, metaDataMap);
+ }
+
+ public ScoreDoc() {
+ }
+
+ public ScoreDoc(
+ double score,
+ DocLocation docLocation,
+ List<ByteBuffer> fields)
+ {
+ this();
+ this.score = score;
+ setScoreIsSet(true);
+ this.docLocation = docLocation;
+ this.fields = fields;
+ }
+
+ /**
+ * Performs a deep copy on <i>other</i>.
+ */
+ public ScoreDoc(ScoreDoc other) {
+ __isset_bit_vector.clear();
+ __isset_bit_vector.or(other.__isset_bit_vector);
+ this.score = other.score;
+ if (other.isSetDocLocation()) {
+ this.docLocation = new DocLocation(other.docLocation);
+ }
+ if (other.isSetFields()) {
+ List<ByteBuffer> __this__fields = new ArrayList<ByteBuffer>();
+ for (ByteBuffer other_element : other.fields) {
+ ByteBuffer temp_binary_element = org.apache.thrift.TBaseHelper.copyBinary(other_element);
+;
+ __this__fields.add(temp_binary_element);
+ }
+ this.fields = __this__fields;
+ }
+ }
+
+ public ScoreDoc deepCopy() {
+ return new ScoreDoc(this);
+ }
+
+ @Override
+ public void clear() {
+ setScoreIsSet(false);
+ this.score = 0.0;
+ this.docLocation = null;
+ this.fields = null;
+ }
+
+ public double getScore() {
+ return this.score;
+ }
+
+ public ScoreDoc setScore(double score) {
+ this.score = score;
+ setScoreIsSet(true);
+ return this;
+ }
+
+ public void unsetScore() {
+ __isset_bit_vector.clear(__SCORE_ISSET_ID);
+ }
+
+ /** Returns true if field score is set (has been assigned a value) and false otherwise */
+ public boolean isSetScore() {
+ return __isset_bit_vector.get(__SCORE_ISSET_ID);
+ }
+
+ public void setScoreIsSet(boolean value) {
+ __isset_bit_vector.set(__SCORE_ISSET_ID, value);
+ }
+
+ public DocLocation getDocLocation() {
+ return this.docLocation;
+ }
+
+ public ScoreDoc setDocLocation(DocLocation docLocation) {
+ this.docLocation = docLocation;
+ return this;
+ }
+
+ public void unsetDocLocation() {
+ this.docLocation = null;
+ }
+
+ /** Returns true if field docLocation is set (has been assigned a value) and false otherwise */
+ public boolean isSetDocLocation() {
+ return this.docLocation != null;
+ }
+
+ public void setDocLocationIsSet(boolean value) {
+ if (!value) {
+ this.docLocation = null;
+ }
+ }
+
+ public int getFieldsSize() {
+ return (this.fields == null) ? 0 : this.fields.size();
+ }
+
+ public java.util.Iterator<ByteBuffer> getFieldsIterator() {
+ return (this.fields == null) ? null : this.fields.iterator();
+ }
+
+ public void addToFields(ByteBuffer elem) {
+ if (this.fields == null) {
+ this.fields = new ArrayList<ByteBuffer>();
+ }
+ this.fields.add(elem);
+ }
+
+ public List<ByteBuffer> getFields() {
+ return this.fields;
+ }
+
+ public ScoreDoc setFields(List<ByteBuffer> fields) {
+ this.fields = fields;
+ return this;
+ }
+
+ public void unsetFields() {
+ this.fields = null;
+ }
+
+ /** Returns true if field fields is set (has been assigned a value) and false otherwise */
+ public boolean isSetFields() {
+ return this.fields != null;
+ }
+
+ public void setFieldsIsSet(boolean value) {
+ if (!value) {
+ this.fields = null;
+ }
+ }
+
+ public void setFieldValue(_Fields field, Object value) {
+ switch (field) {
+ case SCORE:
+ if (value == null) {
+ unsetScore();
+ } else {
+ setScore((Double)value);
+ }
+ break;
+
+ case DOC_LOCATION:
+ if (value == null) {
+ unsetDocLocation();
+ } else {
+ setDocLocation((DocLocation)value);
+ }
+ break;
+
+ case FIELDS:
+ if (value == null) {
+ unsetFields();
+ } else {
+ setFields((List<ByteBuffer>)value);
+ }
+ break;
+
+ }
+ }
+
+ public Object getFieldValue(_Fields field) {
+ switch (field) {
+ case SCORE:
+ return Double.valueOf(getScore());
+
+ case DOC_LOCATION:
+ return getDocLocation();
+
+ case FIELDS:
+ return getFields();
+
+ }
+ 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 SCORE:
+ return isSetScore();
+ case DOC_LOCATION:
+ return isSetDocLocation();
+ case FIELDS:
+ return isSetFields();
+ }
+ throw new IllegalStateException();
+ }
+
+ @Override
+ public boolean equals(Object that) {
+ if (that == null)
+ return false;
+ if (that instanceof ScoreDoc)
+ return this.equals((ScoreDoc)that);
+ return false;
+ }
+
+ public boolean equals(ScoreDoc that) {
+ if (that == null)
+ return false;
+
+ boolean this_present_score = true;
+ boolean that_present_score = true;
+ if (this_present_score || that_present_score) {
+ if (!(this_present_score && that_present_score))
+ return false;
+ if (this.score != that.score)
+ return false;
+ }
+
+ boolean this_present_docLocation = true && this.isSetDocLocation();
+ boolean that_present_docLocation = true && that.isSetDocLocation();
+ if (this_present_docLocation || that_present_docLocation) {
+ if (!(this_present_docLocation && that_present_docLocation))
+ return false;
+ if (!this.docLocation.equals(that.docLocation))
+ return false;
+ }
+
+ boolean this_present_fields = true && this.isSetFields();
+ boolean that_present_fields = true && that.isSetFields();
+ if (this_present_fields || that_present_fields) {
+ if (!(this_present_fields && that_present_fields))
+ return false;
+ if (!this.fields.equals(that.fields))
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ return 0;
+ }
+
+ public int compareTo(ScoreDoc other) {
+ if (!getClass().equals(other.getClass())) {
+ return getClass().getName().compareTo(other.getClass().getName());
+ }
+
+ int lastComparison = 0;
+ ScoreDoc typedOther = (ScoreDoc)other;
+
+ lastComparison = Boolean.valueOf(isSetScore()).compareTo(typedOther.isSetScore());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetScore()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.score, typedOther.score);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetDocLocation()).compareTo(typedOther.isSetDocLocation());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetDocLocation()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.docLocation, typedOther.docLocation);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetFields()).compareTo(typedOther.isSetFields());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetFields()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.fields, typedOther.fields);
+ 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: // SCORE
+ if (field.type == org.apache.thrift.protocol.TType.DOUBLE) {
+ this.score = iprot.readDouble();
+ setScoreIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
+ }
+ break;
+ case 2: // DOC_LOCATION
+ if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
+ this.docLocation = new DocLocation();
+ this.docLocation.read(iprot);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
+ }
+ break;
+ case 4: // FIELDS
+ if (field.type == org.apache.thrift.protocol.TType.LIST) {
+ {
+ org.apache.thrift.protocol.TList _list92 = iprot.readListBegin();
+ this.fields = new ArrayList<ByteBuffer>(_list92.size);
+ for (int _i93 = 0; _i93 < _list92.size; ++_i93)
+ {
+ ByteBuffer _elem94; // required
+ _elem94 = iprot.readBinary();
+ this.fields.add(_elem94);
+ }
+ iprot.readListEnd();
+ }
+ } 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);
+ oprot.writeFieldBegin(SCORE_FIELD_DESC);
+ oprot.writeDouble(this.score);
+ oprot.writeFieldEnd();
+ if (this.docLocation != null) {
+ oprot.writeFieldBegin(DOC_LOCATION_FIELD_DESC);
+ this.docLocation.write(oprot);
+ oprot.writeFieldEnd();
+ }
+ if (this.fields != null) {
+ oprot.writeFieldBegin(FIELDS_FIELD_DESC);
+ {
+ oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, this.fields.size()));
+ for (ByteBuffer _iter95 : this.fields)
+ {
+ oprot.writeBinary(_iter95);
+ }
+ oprot.writeListEnd();
+ }
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder("ScoreDoc(");
+ boolean first = true;
+
+ sb.append("score:");
+ sb.append(this.score);
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("docLocation:");
+ if (this.docLocation == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.docLocation);
+ }
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("fields:");
+ if (this.fields == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.fields);
+ }
+ first = false;
+ sb.append(")");
+ return sb.toString();
+ }
+
+ public void validate() throws org.apache.thrift.TException {
+ // check for required fields
+ }
+
+ 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);
+ }
+ }
+
+}
+
http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/1e930bbc/interface/gen-java/org/apache/blur/thrift/generated/Session.java
----------------------------------------------------------------------
diff --git a/interface/gen-java/org/apache/blur/thrift/generated/Session.java b/interface/gen-java/org/apache/blur/thrift/generated/Session.java
new file mode 100644
index 0000000..503c798
--- /dev/null
+++ b/interface/gen-java/org/apache/blur/thrift/generated/Session.java
@@ -0,0 +1,472 @@
+/**
+ * Autogenerated by Thrift Compiler (0.7.0)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ */
+package org.apache.blur.thrift.generated;
+
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+
+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 Session implements org.apache.thrift.TBase<Session, Session._Fields>, java.io.Serializable, Cloneable {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("Session");
+
+ private static final org.apache.thrift.protocol.TField SESSION_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("sessionId", org.apache.thrift.protocol.TType.STRING, (short)1);
+ private static final org.apache.thrift.protocol.TField PROPERTIES_FIELD_DESC = new org.apache.thrift.protocol.TField("properties", org.apache.thrift.protocol.TType.MAP, (short)2);
+
+ public String sessionId; // required
+ public Map<String,String> properties; // 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 {
+ SESSION_ID((short)1, "sessionId"),
+ PROPERTIES((short)2, "properties");
+
+ 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: // SESSION_ID
+ return SESSION_ID;
+ case 2: // PROPERTIES
+ return PROPERTIES;
+ 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
+
+ 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.SESSION_ID, new org.apache.thrift.meta_data.FieldMetaData("sessionId", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+ tmpMap.put(_Fields.PROPERTIES, new org.apache.thrift.meta_data.FieldMetaData("properties", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ 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(Session.class, metaDataMap);
+ }
+
+ public Session() {
+ }
+
+ public Session(
+ String sessionId,
+ Map<String,String> properties)
+ {
+ this();
+ this.sessionId = sessionId;
+ this.properties = properties;
+ }
+
+ /**
+ * Performs a deep copy on <i>other</i>.
+ */
+ public Session(Session other) {
+ if (other.isSetSessionId()) {
+ this.sessionId = other.sessionId;
+ }
+ if (other.isSetProperties()) {
+ Map<String,String> __this__properties = new HashMap<String,String>();
+ for (Map.Entry<String, String> other_element : other.properties.entrySet()) {
+
+ String other_element_key = other_element.getKey();
+ String other_element_value = other_element.getValue();
+
+ String __this__properties_copy_key = other_element_key;
+
+ String __this__properties_copy_value = other_element_value;
+
+ __this__properties.put(__this__properties_copy_key, __this__properties_copy_value);
+ }
+ this.properties = __this__properties;
+ }
+ }
+
+ public Session deepCopy() {
+ return new Session(this);
+ }
+
+ @Override
+ public void clear() {
+ this.sessionId = null;
+ this.properties = null;
+ }
+
+ public String getSessionId() {
+ return this.sessionId;
+ }
+
+ public Session setSessionId(String sessionId) {
+ this.sessionId = sessionId;
+ return this;
+ }
+
+ public void unsetSessionId() {
+ this.sessionId = null;
+ }
+
+ /** Returns true if field sessionId is set (has been assigned a value) and false otherwise */
+ public boolean isSetSessionId() {
+ return this.sessionId != null;
+ }
+
+ public void setSessionIdIsSet(boolean value) {
+ if (!value) {
+ this.sessionId = null;
+ }
+ }
+
+ public int getPropertiesSize() {
+ return (this.properties == null) ? 0 : this.properties.size();
+ }
+
+ public void putToProperties(String key, String val) {
+ if (this.properties == null) {
+ this.properties = new HashMap<String,String>();
+ }
+ this.properties.put(key, val);
+ }
+
+ public Map<String,String> getProperties() {
+ return this.properties;
+ }
+
+ public Session setProperties(Map<String,String> properties) {
+ this.properties = properties;
+ return this;
+ }
+
+ public void unsetProperties() {
+ this.properties = null;
+ }
+
+ /** Returns true if field properties is set (has been assigned a value) and false otherwise */
+ public boolean isSetProperties() {
+ return this.properties != null;
+ }
+
+ public void setPropertiesIsSet(boolean value) {
+ if (!value) {
+ this.properties = null;
+ }
+ }
+
+ public void setFieldValue(_Fields field, Object value) {
+ switch (field) {
+ case SESSION_ID:
+ if (value == null) {
+ unsetSessionId();
+ } else {
+ setSessionId((String)value);
+ }
+ break;
+
+ case PROPERTIES:
+ if (value == null) {
+ unsetProperties();
+ } else {
+ setProperties((Map<String,String>)value);
+ }
+ break;
+
+ }
+ }
+
+ public Object getFieldValue(_Fields field) {
+ switch (field) {
+ case SESSION_ID:
+ return getSessionId();
+
+ case PROPERTIES:
+ return getProperties();
+
+ }
+ 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 SESSION_ID:
+ return isSetSessionId();
+ case PROPERTIES:
+ return isSetProperties();
+ }
+ throw new IllegalStateException();
+ }
+
+ @Override
+ public boolean equals(Object that) {
+ if (that == null)
+ return false;
+ if (that instanceof Session)
+ return this.equals((Session)that);
+ return false;
+ }
+
+ public boolean equals(Session that) {
+ if (that == null)
+ return false;
+
+ boolean this_present_sessionId = true && this.isSetSessionId();
+ boolean that_present_sessionId = true && that.isSetSessionId();
+ if (this_present_sessionId || that_present_sessionId) {
+ if (!(this_present_sessionId && that_present_sessionId))
+ return false;
+ if (!this.sessionId.equals(that.sessionId))
+ return false;
+ }
+
+ boolean this_present_properties = true && this.isSetProperties();
+ boolean that_present_properties = true && that.isSetProperties();
+ if (this_present_properties || that_present_properties) {
+ if (!(this_present_properties && that_present_properties))
+ return false;
+ if (!this.properties.equals(that.properties))
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ return 0;
+ }
+
+ public int compareTo(Session other) {
+ if (!getClass().equals(other.getClass())) {
+ return getClass().getName().compareTo(other.getClass().getName());
+ }
+
+ int lastComparison = 0;
+ Session typedOther = (Session)other;
+
+ lastComparison = Boolean.valueOf(isSetSessionId()).compareTo(typedOther.isSetSessionId());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetSessionId()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionId, typedOther.sessionId);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetProperties()).compareTo(typedOther.isSetProperties());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetProperties()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.properties, typedOther.properties);
+ 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: // SESSION_ID
+ if (field.type == org.apache.thrift.protocol.TType.STRING) {
+ this.sessionId = iprot.readString();
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
+ }
+ break;
+ case 2: // PROPERTIES
+ if (field.type == org.apache.thrift.protocol.TType.MAP) {
+ {
+ org.apache.thrift.protocol.TMap _map83 = iprot.readMapBegin();
+ this.properties = new HashMap<String,String>(2*_map83.size);
+ for (int _i84 = 0; _i84 < _map83.size; ++_i84)
+ {
+ String _key85; // required
+ String _val86; // required
+ _key85 = iprot.readString();
+ _val86 = iprot.readString();
+ this.properties.put(_key85, _val86);
+ }
+ iprot.readMapEnd();
+ }
+ } 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.sessionId != null) {
+ oprot.writeFieldBegin(SESSION_ID_FIELD_DESC);
+ oprot.writeString(this.sessionId);
+ oprot.writeFieldEnd();
+ }
+ if (this.properties != null) {
+ oprot.writeFieldBegin(PROPERTIES_FIELD_DESC);
+ {
+ oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, this.properties.size()));
+ for (Map.Entry<String, String> _iter87 : this.properties.entrySet())
+ {
+ oprot.writeString(_iter87.getKey());
+ oprot.writeString(_iter87.getValue());
+ }
+ oprot.writeMapEnd();
+ }
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder("Session(");
+ boolean first = true;
+
+ sb.append("sessionId:");
+ if (this.sessionId == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.sessionId);
+ }
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("properties:");
+ if (this.properties == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.properties);
+ }
+ first = false;
+ sb.append(")");
+ return sb.toString();
+ }
+
+ public void validate() throws org.apache.thrift.TException {
+ // check for required fields
+ }
+
+ 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 {
+ 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);
+ }
+ }
+
+}
+
|