incubator-blur-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amccu...@apache.org
Subject [25/25] Regenerated thrift code.
Date Tue, 30 Oct 2012 00:15:29 GMT
http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/1befa5f5/src/blur-thrift/src/main/java/org/apache/blur/thrift/generated/TopFieldDocs.java
----------------------------------------------------------------------
diff --git a/src/blur-thrift/src/main/java/org/apache/blur/thrift/generated/TopFieldDocs.java
b/src/blur-thrift/src/main/java/org/apache/blur/thrift/generated/TopFieldDocs.java
index b0f0b7a..c0f97e5 100644
--- a/src/blur-thrift/src/main/java/org/apache/blur/thrift/generated/TopFieldDocs.java
+++ b/src/blur-thrift/src/main/java/org/apache/blur/thrift/generated/TopFieldDocs.java
@@ -1,7 +1,8 @@
 /**
- * Autogenerated by Thrift Compiler (0.7.0)
+ * Autogenerated by Thrift Compiler (0.9.0)
  *
  * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ *  @generated
  */
 package org.apache.blur.thrift.generated;
 
@@ -24,6 +25,15 @@ package org.apache.blur.thrift.generated;
 
 
 
+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 java.util.List;
 import java.util.ArrayList;
 import java.util.Map;
@@ -42,11 +52,19 @@ import org.slf4j.LoggerFactory;
 public class TopFieldDocs implements org.apache.thrift.TBase<TopFieldDocs, TopFieldDocs._Fields>,
java.io.Serializable, Cloneable {
   private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TopFieldDocs");
 
-  private static final org.apache.thrift.protocol.TField TOTAL_HITS_FIELD_DESC = new org.apache.thrift.protocol.TField("totalHits",
org.apache.thrift.protocol.TType.I64, (short)1);
-  private static final org.apache.thrift.protocol.TField SCORE_DOCS_FIELD_DESC = new org.apache.thrift.protocol.TField("scoreDocs",
org.apache.thrift.protocol.TType.LIST, (short)2);
-  private static final org.apache.thrift.protocol.TField MAX_SCORE_FIELD_DESC = new org.apache.thrift.protocol.TField("maxScore",
org.apache.thrift.protocol.TType.DOUBLE, (short)3);
-  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);
+  private static final org.apache.thrift.protocol.TField SHARD_INDEX_FIELD_DESC = new org.apache.thrift.protocol.TField("shardIndex",
org.apache.thrift.protocol.TType.I32, (short)1);
+  private static final org.apache.thrift.protocol.TField TOTAL_HITS_FIELD_DESC = new org.apache.thrift.protocol.TField("totalHits",
org.apache.thrift.protocol.TType.I64, (short)2);
+  private static final org.apache.thrift.protocol.TField SCORE_DOCS_FIELD_DESC = new org.apache.thrift.protocol.TField("scoreDocs",
org.apache.thrift.protocol.TType.LIST, (short)3);
+  private static final org.apache.thrift.protocol.TField MAX_SCORE_FIELD_DESC = new org.apache.thrift.protocol.TField("maxScore",
org.apache.thrift.protocol.TType.DOUBLE, (short)4);
+  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)5);
 
+  private static final Map<Class<? extends IScheme>, SchemeFactory> schemes =
new HashMap<Class<? extends IScheme>, SchemeFactory>();
+  static {
+    schemes.put(StandardScheme.class, new TopFieldDocsStandardSchemeFactory());
+    schemes.put(TupleScheme.class, new TopFieldDocsTupleSchemeFactory());
+  }
+
+  public int shardIndex; // required
   public long totalHits; // required
   public List<ScoreDoc> scoreDocs; // required
   public double maxScore; // required
@@ -54,10 +72,11 @@ public class TopFieldDocs implements org.apache.thrift.TBase<TopFieldDocs,
TopFi
 
   /** The set of fields this struct contains, along with convenience methods for finding
and manipulating them. */
   public enum _Fields implements org.apache.thrift.TFieldIdEnum {
-    TOTAL_HITS((short)1, "totalHits"),
-    SCORE_DOCS((short)2, "scoreDocs"),
-    MAX_SCORE((short)3, "maxScore"),
-    FIELDS((short)4, "fields");
+    SHARD_INDEX((short)1, "shardIndex"),
+    TOTAL_HITS((short)2, "totalHits"),
+    SCORE_DOCS((short)3, "scoreDocs"),
+    MAX_SCORE((short)4, "maxScore"),
+    FIELDS((short)5, "fields");
 
     private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
 
@@ -72,13 +91,15 @@ public class TopFieldDocs implements org.apache.thrift.TBase<TopFieldDocs,
TopFi
      */
     public static _Fields findByThriftId(int fieldId) {
       switch(fieldId) {
-        case 1: // TOTAL_HITS
+        case 1: // SHARD_INDEX
+          return SHARD_INDEX;
+        case 2: // TOTAL_HITS
           return TOTAL_HITS;
-        case 2: // SCORE_DOCS
+        case 3: // SCORE_DOCS
           return SCORE_DOCS;
-        case 3: // MAX_SCORE
+        case 4: // MAX_SCORE
           return MAX_SCORE;
-        case 4: // FIELDS
+        case 5: // FIELDS
           return FIELDS;
         default:
           return null;
@@ -120,13 +141,15 @@ public class TopFieldDocs implements org.apache.thrift.TBase<TopFieldDocs,
TopFi
   }
 
   // isset id assignments
-  private static final int __TOTALHITS_ISSET_ID = 0;
-  private static final int __MAXSCORE_ISSET_ID = 1;
-  private BitSet __isset_bit_vector = new BitSet(2);
-
+  private static final int __SHARDINDEX_ISSET_ID = 0;
+  private static final int __TOTALHITS_ISSET_ID = 1;
+  private static final int __MAXSCORE_ISSET_ID = 2;
+  private byte __isset_bitfield = 0;
   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.SHARD_INDEX, new org.apache.thrift.meta_data.FieldMetaData("shardIndex",
org.apache.thrift.TFieldRequirementType.DEFAULT, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
     tmpMap.put(_Fields.TOTAL_HITS, new org.apache.thrift.meta_data.FieldMetaData("totalHits",
org.apache.thrift.TFieldRequirementType.DEFAULT, 
         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
     tmpMap.put(_Fields.SCORE_DOCS, new org.apache.thrift.meta_data.FieldMetaData("scoreDocs",
org.apache.thrift.TFieldRequirementType.DEFAULT, 
@@ -145,12 +168,15 @@ public class TopFieldDocs implements org.apache.thrift.TBase<TopFieldDocs,
TopFi
   }
 
   public TopFieldDocs(
+    int shardIndex,
     long totalHits,
     List<ScoreDoc> scoreDocs,
     double maxScore,
     List<SortField> fields)
   {
     this();
+    this.shardIndex = shardIndex;
+    setShardIndexIsSet(true);
     this.totalHits = totalHits;
     setTotalHitsIsSet(true);
     this.scoreDocs = scoreDocs;
@@ -163,8 +189,8 @@ public class TopFieldDocs implements org.apache.thrift.TBase<TopFieldDocs,
TopFi
    * Performs a deep copy on <i>other</i>.
    */
   public TopFieldDocs(TopFieldDocs other) {
-    __isset_bit_vector.clear();
-    __isset_bit_vector.or(other.__isset_bit_vector);
+    __isset_bitfield = other.__isset_bitfield;
+    this.shardIndex = other.shardIndex;
     this.totalHits = other.totalHits;
     if (other.isSetScoreDocs()) {
       List<ScoreDoc> __this__scoreDocs = new ArrayList<ScoreDoc>();
@@ -189,6 +215,8 @@ public class TopFieldDocs implements org.apache.thrift.TBase<TopFieldDocs,
TopFi
 
   @Override
   public void clear() {
+    setShardIndexIsSet(false);
+    this.shardIndex = 0;
     setTotalHitsIsSet(false);
     this.totalHits = 0;
     this.scoreDocs = null;
@@ -197,6 +225,29 @@ public class TopFieldDocs implements org.apache.thrift.TBase<TopFieldDocs,
TopFi
     this.fields = null;
   }
 
+  public int getShardIndex() {
+    return this.shardIndex;
+  }
+
+  public TopFieldDocs setShardIndex(int shardIndex) {
+    this.shardIndex = shardIndex;
+    setShardIndexIsSet(true);
+    return this;
+  }
+
+  public void unsetShardIndex() {
+    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SHARDINDEX_ISSET_ID);
+  }
+
+  /** Returns true if field shardIndex is set (has been assigned a value) and false otherwise
*/
+  public boolean isSetShardIndex() {
+    return EncodingUtils.testBit(__isset_bitfield, __SHARDINDEX_ISSET_ID);
+  }
+
+  public void setShardIndexIsSet(boolean value) {
+    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SHARDINDEX_ISSET_ID, value);
+  }
+
   public long getTotalHits() {
     return this.totalHits;
   }
@@ -208,16 +259,16 @@ public class TopFieldDocs implements org.apache.thrift.TBase<TopFieldDocs,
TopFi
   }
 
   public void unsetTotalHits() {
-    __isset_bit_vector.clear(__TOTALHITS_ISSET_ID);
+    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __TOTALHITS_ISSET_ID);
   }
 
   /** Returns true if field totalHits is set (has been assigned a value) and false otherwise
*/
   public boolean isSetTotalHits() {
-    return __isset_bit_vector.get(__TOTALHITS_ISSET_ID);
+    return EncodingUtils.testBit(__isset_bitfield, __TOTALHITS_ISSET_ID);
   }
 
   public void setTotalHitsIsSet(boolean value) {
-    __isset_bit_vector.set(__TOTALHITS_ISSET_ID, value);
+    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __TOTALHITS_ISSET_ID, value);
   }
 
   public int getScoreDocsSize() {
@@ -270,16 +321,16 @@ public class TopFieldDocs implements org.apache.thrift.TBase<TopFieldDocs,
TopFi
   }
 
   public void unsetMaxScore() {
-    __isset_bit_vector.clear(__MAXSCORE_ISSET_ID);
+    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __MAXSCORE_ISSET_ID);
   }
 
   /** Returns true if field maxScore is set (has been assigned a value) and false otherwise
*/
   public boolean isSetMaxScore() {
-    return __isset_bit_vector.get(__MAXSCORE_ISSET_ID);
+    return EncodingUtils.testBit(__isset_bitfield, __MAXSCORE_ISSET_ID);
   }
 
   public void setMaxScoreIsSet(boolean value) {
-    __isset_bit_vector.set(__MAXSCORE_ISSET_ID, value);
+    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __MAXSCORE_ISSET_ID, value);
   }
 
   public int getFieldsSize() {
@@ -323,6 +374,14 @@ public class TopFieldDocs implements org.apache.thrift.TBase<TopFieldDocs,
TopFi
 
   public void setFieldValue(_Fields field, Object value) {
     switch (field) {
+    case SHARD_INDEX:
+      if (value == null) {
+        unsetShardIndex();
+      } else {
+        setShardIndex((Integer)value);
+      }
+      break;
+
     case TOTAL_HITS:
       if (value == null) {
         unsetTotalHits();
@@ -360,6 +419,9 @@ public class TopFieldDocs implements org.apache.thrift.TBase<TopFieldDocs,
TopFi
 
   public Object getFieldValue(_Fields field) {
     switch (field) {
+    case SHARD_INDEX:
+      return Integer.valueOf(getShardIndex());
+
     case TOTAL_HITS:
       return Long.valueOf(getTotalHits());
 
@@ -383,6 +445,8 @@ public class TopFieldDocs implements org.apache.thrift.TBase<TopFieldDocs,
TopFi
     }
 
     switch (field) {
+    case SHARD_INDEX:
+      return isSetShardIndex();
     case TOTAL_HITS:
       return isSetTotalHits();
     case SCORE_DOCS:
@@ -408,6 +472,15 @@ public class TopFieldDocs implements org.apache.thrift.TBase<TopFieldDocs,
TopFi
     if (that == null)
       return false;
 
+    boolean this_present_shardIndex = true;
+    boolean that_present_shardIndex = true;
+    if (this_present_shardIndex || that_present_shardIndex) {
+      if (!(this_present_shardIndex && that_present_shardIndex))
+        return false;
+      if (this.shardIndex != that.shardIndex)
+        return false;
+    }
+
     boolean this_present_totalHits = true;
     boolean that_present_totalHits = true;
     if (this_present_totalHits || that_present_totalHits) {
@@ -460,6 +533,16 @@ public class TopFieldDocs implements org.apache.thrift.TBase<TopFieldDocs,
TopFi
     int lastComparison = 0;
     TopFieldDocs typedOther = (TopFieldDocs)other;
 
+    lastComparison = Boolean.valueOf(isSetShardIndex()).compareTo(typedOther.isSetShardIndex());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetShardIndex()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.shardIndex, typedOther.shardIndex);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
     lastComparison = Boolean.valueOf(isSetTotalHits()).compareTo(typedOther.isSetTotalHits());
     if (lastComparison != 0) {
       return lastComparison;
@@ -508,114 +591,11 @@ public class TopFieldDocs implements org.apache.thrift.TBase<TopFieldDocs,
TopFi
   }
 
   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: // TOTAL_HITS
-          if (field.type == org.apache.thrift.protocol.TType.I64) {
-            this.totalHits = iprot.readI64();
-            setTotalHitsIsSet(true);
-          } else { 
-            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
-          }
-          break;
-        case 2: // SCORE_DOCS
-          if (field.type == org.apache.thrift.protocol.TType.LIST) {
-            {
-              org.apache.thrift.protocol.TList _list100 = iprot.readListBegin();
-              this.scoreDocs = new ArrayList<ScoreDoc>(_list100.size);
-              for (int _i101 = 0; _i101 < _list100.size; ++_i101)
-              {
-                ScoreDoc _elem102; // required
-                _elem102 = new ScoreDoc();
-                _elem102.read(iprot);
-                this.scoreDocs.add(_elem102);
-              }
-              iprot.readListEnd();
-            }
-          } else { 
-            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
-          }
-          break;
-        case 3: // MAX_SCORE
-          if (field.type == org.apache.thrift.protocol.TType.DOUBLE) {
-            this.maxScore = iprot.readDouble();
-            setMaxScoreIsSet(true);
-          } 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 _list103 = iprot.readListBegin();
-              this.fields = new ArrayList<SortField>(_list103.size);
-              for (int _i104 = 0; _i104 < _list103.size; ++_i104)
-              {
-                SortField _elem105; // required
-                _elem105 = new SortField();
-                _elem105.read(iprot);
-                this.fields.add(_elem105);
-              }
-              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();
+    schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
   }
 
   public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException
{
-    validate();
-
-    oprot.writeStructBegin(STRUCT_DESC);
-    oprot.writeFieldBegin(TOTAL_HITS_FIELD_DESC);
-    oprot.writeI64(this.totalHits);
-    oprot.writeFieldEnd();
-    if (this.scoreDocs != null) {
-      oprot.writeFieldBegin(SCORE_DOCS_FIELD_DESC);
-      {
-        oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT,
this.scoreDocs.size()));
-        for (ScoreDoc _iter106 : this.scoreDocs)
-        {
-          _iter106.write(oprot);
-        }
-        oprot.writeListEnd();
-      }
-      oprot.writeFieldEnd();
-    }
-    oprot.writeFieldBegin(MAX_SCORE_FIELD_DESC);
-    oprot.writeDouble(this.maxScore);
-    oprot.writeFieldEnd();
-    if (this.fields != null) {
-      oprot.writeFieldBegin(FIELDS_FIELD_DESC);
-      {
-        oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT,
this.fields.size()));
-        for (SortField _iter107 : this.fields)
-        {
-          _iter107.write(oprot);
-        }
-        oprot.writeListEnd();
-      }
-      oprot.writeFieldEnd();
-    }
-    oprot.writeFieldStop();
-    oprot.writeStructEnd();
+    schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
   }
 
   @Override
@@ -623,6 +603,10 @@ public class TopFieldDocs implements org.apache.thrift.TBase<TopFieldDocs,
TopFi
     StringBuilder sb = new StringBuilder("TopFieldDocs(");
     boolean first = true;
 
+    sb.append("shardIndex:");
+    sb.append(this.shardIndex);
+    first = false;
+    if (!first) sb.append(", ");
     sb.append("totalHits:");
     sb.append(this.totalHits);
     first = false;
@@ -652,6 +636,7 @@ public class TopFieldDocs implements org.apache.thrift.TBase<TopFieldDocs,
TopFi
 
   public void validate() throws org.apache.thrift.TException {
     // check for required fields
+    // check for sub-struct validity
   }
 
   private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
@@ -665,12 +650,250 @@ public class TopFieldDocs implements org.apache.thrift.TBase<TopFieldDocs,
TopFi
   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);
+      __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 TopFieldDocsStandardSchemeFactory implements SchemeFactory {
+    public TopFieldDocsStandardScheme getScheme() {
+      return new TopFieldDocsStandardScheme();
+    }
+  }
+
+  private static class TopFieldDocsStandardScheme extends StandardScheme<TopFieldDocs>
{
+
+    public void read(org.apache.thrift.protocol.TProtocol iprot, TopFieldDocs 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: // SHARD_INDEX
+            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
+              struct.shardIndex = iprot.readI32();
+              struct.setShardIndexIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 2: // TOTAL_HITS
+            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
+              struct.totalHits = iprot.readI64();
+              struct.setTotalHitsIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 3: // SCORE_DOCS
+            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
+              {
+                org.apache.thrift.protocol.TList _list200 = iprot.readListBegin();
+                struct.scoreDocs = new ArrayList<ScoreDoc>(_list200.size);
+                for (int _i201 = 0; _i201 < _list200.size; ++_i201)
+                {
+                  ScoreDoc _elem202; // required
+                  _elem202 = new ScoreDoc();
+                  _elem202.read(iprot);
+                  struct.scoreDocs.add(_elem202);
+                }
+                iprot.readListEnd();
+              }
+              struct.setScoreDocsIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 4: // MAX_SCORE
+            if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) {
+              struct.maxScore = iprot.readDouble();
+              struct.setMaxScoreIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 5: // FIELDS
+            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
+              {
+                org.apache.thrift.protocol.TList _list203 = iprot.readListBegin();
+                struct.fields = new ArrayList<SortField>(_list203.size);
+                for (int _i204 = 0; _i204 < _list203.size; ++_i204)
+                {
+                  SortField _elem205; // required
+                  _elem205 = new SortField();
+                  _elem205.read(iprot);
+                  struct.fields.add(_elem205);
+                }
+                iprot.readListEnd();
+              }
+              struct.setFieldsIsSet(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();
+
+      // check for required fields of primitive type, which can't be checked in the validate
method
+      struct.validate();
+    }
+
+    public void write(org.apache.thrift.protocol.TProtocol oprot, TopFieldDocs struct) throws
org.apache.thrift.TException {
+      struct.validate();
+
+      oprot.writeStructBegin(STRUCT_DESC);
+      oprot.writeFieldBegin(SHARD_INDEX_FIELD_DESC);
+      oprot.writeI32(struct.shardIndex);
+      oprot.writeFieldEnd();
+      oprot.writeFieldBegin(TOTAL_HITS_FIELD_DESC);
+      oprot.writeI64(struct.totalHits);
+      oprot.writeFieldEnd();
+      if (struct.scoreDocs != null) {
+        oprot.writeFieldBegin(SCORE_DOCS_FIELD_DESC);
+        {
+          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT,
struct.scoreDocs.size()));
+          for (ScoreDoc _iter206 : struct.scoreDocs)
+          {
+            _iter206.write(oprot);
+          }
+          oprot.writeListEnd();
+        }
+        oprot.writeFieldEnd();
+      }
+      oprot.writeFieldBegin(MAX_SCORE_FIELD_DESC);
+      oprot.writeDouble(struct.maxScore);
+      oprot.writeFieldEnd();
+      if (struct.fields != null) {
+        oprot.writeFieldBegin(FIELDS_FIELD_DESC);
+        {
+          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT,
struct.fields.size()));
+          for (SortField _iter207 : struct.fields)
+          {
+            _iter207.write(oprot);
+          }
+          oprot.writeListEnd();
+        }
+        oprot.writeFieldEnd();
+      }
+      oprot.writeFieldStop();
+      oprot.writeStructEnd();
+    }
+
+  }
+
+  private static class TopFieldDocsTupleSchemeFactory implements SchemeFactory {
+    public TopFieldDocsTupleScheme getScheme() {
+      return new TopFieldDocsTupleScheme();
+    }
+  }
+
+  private static class TopFieldDocsTupleScheme extends TupleScheme<TopFieldDocs> {
+
+    @Override
+    public void write(org.apache.thrift.protocol.TProtocol prot, TopFieldDocs struct) throws
org.apache.thrift.TException {
+      TTupleProtocol oprot = (TTupleProtocol) prot;
+      BitSet optionals = new BitSet();
+      if (struct.isSetShardIndex()) {
+        optionals.set(0);
+      }
+      if (struct.isSetTotalHits()) {
+        optionals.set(1);
+      }
+      if (struct.isSetScoreDocs()) {
+        optionals.set(2);
+      }
+      if (struct.isSetMaxScore()) {
+        optionals.set(3);
+      }
+      if (struct.isSetFields()) {
+        optionals.set(4);
+      }
+      oprot.writeBitSet(optionals, 5);
+      if (struct.isSetShardIndex()) {
+        oprot.writeI32(struct.shardIndex);
+      }
+      if (struct.isSetTotalHits()) {
+        oprot.writeI64(struct.totalHits);
+      }
+      if (struct.isSetScoreDocs()) {
+        {
+          oprot.writeI32(struct.scoreDocs.size());
+          for (ScoreDoc _iter208 : struct.scoreDocs)
+          {
+            _iter208.write(oprot);
+          }
+        }
+      }
+      if (struct.isSetMaxScore()) {
+        oprot.writeDouble(struct.maxScore);
+      }
+      if (struct.isSetFields()) {
+        {
+          oprot.writeI32(struct.fields.size());
+          for (SortField _iter209 : struct.fields)
+          {
+            _iter209.write(oprot);
+          }
+        }
+      }
+    }
+
+    @Override
+    public void read(org.apache.thrift.protocol.TProtocol prot, TopFieldDocs struct) throws
org.apache.thrift.TException {
+      TTupleProtocol iprot = (TTupleProtocol) prot;
+      BitSet incoming = iprot.readBitSet(5);
+      if (incoming.get(0)) {
+        struct.shardIndex = iprot.readI32();
+        struct.setShardIndexIsSet(true);
+      }
+      if (incoming.get(1)) {
+        struct.totalHits = iprot.readI64();
+        struct.setTotalHitsIsSet(true);
+      }
+      if (incoming.get(2)) {
+        {
+          org.apache.thrift.protocol.TList _list210 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT,
iprot.readI32());
+          struct.scoreDocs = new ArrayList<ScoreDoc>(_list210.size);
+          for (int _i211 = 0; _i211 < _list210.size; ++_i211)
+          {
+            ScoreDoc _elem212; // required
+            _elem212 = new ScoreDoc();
+            _elem212.read(iprot);
+            struct.scoreDocs.add(_elem212);
+          }
+        }
+        struct.setScoreDocsIsSet(true);
+      }
+      if (incoming.get(3)) {
+        struct.maxScore = iprot.readDouble();
+        struct.setMaxScoreIsSet(true);
+      }
+      if (incoming.get(4)) {
+        {
+          org.apache.thrift.protocol.TList _list213 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT,
iprot.readI32());
+          struct.fields = new ArrayList<SortField>(_list213.size);
+          for (int _i214 = 0; _i214 < _list213.size; ++_i214)
+          {
+            SortField _elem215; // required
+            _elem215 = new SortField();
+            _elem215.read(iprot);
+            struct.fields.add(_elem215);
+          }
+        }
+        struct.setFieldsIsSet(true);
+      }
+    }
+  }
+
 }
 


Mime
View raw message