incubator-blur-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amccu...@apache.org
Subject [2/2] git commit: Fixed BLUR-89.
Date Fri, 17 May 2013 21:17:08 GMT
Fixed BLUR-89.


Project: http://git-wip-us.apache.org/repos/asf/incubator-blur/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-blur/commit/09125a39
Tree: http://git-wip-us.apache.org/repos/asf/incubator-blur/tree/09125a39
Diff: http://git-wip-us.apache.org/repos/asf/incubator-blur/diff/09125a39

Branch: refs/heads/0.1.5
Commit: 09125a39513ddf2cfe2b3006fc951c4671ebc773
Parents: 3e3d645
Author: Aaron McCurry <amccurry@gmail.com>
Authored: Fri May 17 17:16:22 2013 -0400
Committer: Aaron McCurry <amccurry@gmail.com>
Committed: Fri May 17 17:16:22 2013 -0400

----------------------------------------------------------------------
 .../java/org/apache/blur/manager/IndexManager.java |    3 +-
 .../main/java/org/apache/blur/utils/BlurUtil.java  |   16 +-
 .../org/apache/blur/manager/IndexManagerTest.java  |   39 +++
 .../org/apache/blur/thrift/generated/Selector.java |  248 ++++++++++++++-
 .../src/main/scripts/interface/Blur.thrift         |   16 +-
 .../src/main/scripts/interface/gen-html/Blur.html  |   10 +
 .../org/apache/blur/thrift/generated/Selector.java |  248 ++++++++++++++-
 .../main/scripts/interface/gen-js/Blur_types.js    |   32 ++
 .../main/scripts/interface/gen-perl/Blur/Types.pm  |   32 ++-
 .../main/scripts/interface/gen-rb/blur_types.rb    |   14 +-
 10 files changed, 643 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/09125a39/src/blur-core/src/main/java/org/apache/blur/manager/IndexManager.java
----------------------------------------------------------------------
diff --git a/src/blur-core/src/main/java/org/apache/blur/manager/IndexManager.java b/src/blur-core/src/main/java/org/apache/blur/manager/IndexManager.java
index e31f736..ab40d9e 100644
--- a/src/blur-core/src/main/java/org/apache/blur/manager/IndexManager.java
+++ b/src/blur-core/src/main/java/org/apache/blur/manager/IndexManager.java
@@ -459,7 +459,8 @@ public class IndexManager {
         fetchResult.exists = true;
         fetchResult.deleted = false;
         String rowId = getRowId(reader, docId);
-        List<Document> docs = BlurUtil.termSearch(reader, new Term(ROW_ID, rowId), getFieldSelector(selector));
+        List<Document> docs = BlurUtil.fetchDocuments(reader, new Term(ROW_ID, rowId), getFieldSelector(selector),
+            selector);
         fetchResult.rowResult = new FetchRowResult(getRow(docs));
         return;
       }

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/09125a39/src/blur-core/src/main/java/org/apache/blur/utils/BlurUtil.java
----------------------------------------------------------------------
diff --git a/src/blur-core/src/main/java/org/apache/blur/utils/BlurUtil.java b/src/blur-core/src/main/java/org/apache/blur/utils/BlurUtil.java
index d75ee50..9780ba8 100644
--- a/src/blur-core/src/main/java/org/apache/blur/utils/BlurUtil.java
+++ b/src/blur-core/src/main/java/org/apache/blur/utils/BlurUtil.java
@@ -667,15 +667,25 @@ public class BlurUtil {
    * NOTE: This is a potentially dangerous call, it will return all the
    * documents that match the term.
    * 
+   * @param selector
+   * 
    * @throws IOException
    */
-  public static List<Document> termSearch(IndexReader reader, Term term,
-      ResetableDocumentStoredFieldVisitor fieldSelector) throws IOException {
+  public static List<Document> fetchDocuments(IndexReader reader, Term term,
+      ResetableDocumentStoredFieldVisitor fieldSelector, Selector selector) throws IOException {
     IndexSearcher indexSearcher = new IndexSearcher(reader);
     int docFreq = reader.docFreq(term);
     TopDocs topDocs = indexSearcher.search(new TermQuery(term), docFreq);
+    int totalHits = topDocs.totalHits;
     List<Document> docs = new ArrayList<Document>();
-    for (int i = 0; i < topDocs.totalHits; i++) {
+
+    int start = selector.getStartRecord();
+    int end = selector.getMaxRecordsToFetch() + start;
+
+    for (int i = start; i < end; i++) {
+      if (i >= totalHits) {
+        break;
+      }
       int doc = topDocs.scoreDocs[i].doc;
       indexSearcher.doc(doc, fieldSelector);
       docs.add(fieldSelector.getDocument());

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/09125a39/src/blur-core/src/test/java/org/apache/blur/manager/IndexManagerTest.java
----------------------------------------------------------------------
diff --git a/src/blur-core/src/test/java/org/apache/blur/manager/IndexManagerTest.java b/src/blur-core/src/test/java/org/apache/blur/manager/IndexManagerTest.java
index dfd9f27..1ce3352 100644
--- a/src/blur-core/src/test/java/org/apache/blur/manager/IndexManagerTest.java
+++ b/src/blur-core/src/test/java/org/apache/blur/manager/IndexManagerTest.java
@@ -403,6 +403,45 @@ public class IndexManagerTest {
     row.recordCount = 1;
     assertEquals(row, fetchResult.rowResult.row);
   }
+  
+  @Test
+  public void testFetchRowByRowIdPaging() throws Exception {
+    Selector selector = new Selector().setRowId("row-6").setStartRecord(0).setMaxRecordsToFetch(1);
+    FetchResult fetchResult = new FetchResult();
+    indexManager.fetchRow(TABLE, selector, fetchResult);
+    assertNotNull(fetchResult.rowResult.row);
+    RowMutation mutation6 = newRowMutation(TABLE, "row-6", 
+        newRecordMutation(FAMILY, "record-6A",  newColumn("testcol12", "value110"), newColumn("testcol13", "value102")),
+        newRecordMutation(FAMILY, "record-6B",  newColumn("testcol12", "value101"), newColumn("testcol13", "value104")),
+        newRecordMutation(FAMILY2, "record-6C", newColumn("testcol18", "value501")));
+    
+    Row row1 = newRow("row-6", newRecord(FAMILY, "record-6A", newColumn("testcol12", "value110"), newColumn("testcol13", "value102")));
+    row1.recordCount = 1;
+    assertEquals(row1, fetchResult.rowResult.row);
+    
+    selector = new Selector().setRowId("row-6").setStartRecord(1).setMaxRecordsToFetch(1);
+    fetchResult = new FetchResult();
+    indexManager.fetchRow(TABLE, selector, fetchResult);
+    assertNotNull(fetchResult.rowResult.row);
+    
+    Row row2 = newRow("row-6", newRecord(FAMILY, "record-6B", newColumn("testcol12", "value101"), newColumn("testcol13", "value104")));
+    row2.recordCount = 1;
+    assertEquals(row2, fetchResult.rowResult.row);
+    
+    selector = new Selector().setRowId("row-6").setStartRecord(2).setMaxRecordsToFetch(1);
+    fetchResult = new FetchResult();
+    indexManager.fetchRow(TABLE, selector, fetchResult);
+    assertNotNull(fetchResult.rowResult.row);
+    
+    Row row3 = newRow("row-6", newRecord(FAMILY2, "record-6C", newColumn("testcol18", "value501")));
+    row3.recordCount = 1;
+    assertEquals(row3, fetchResult.rowResult.row);
+    
+    selector = new Selector().setRowId("row-6").setStartRecord(3).setMaxRecordsToFetch(1);
+    fetchResult = new FetchResult();
+    indexManager.fetchRow(TABLE, selector, fetchResult);
+    assertNull(fetchResult.rowResult.row);
+  }
 
   @Test
   public void testFetchRowByRecordIdOnly() throws Exception {

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/09125a39/src/blur-thrift/src/main/java/org/apache/blur/thrift/generated/Selector.java
----------------------------------------------------------------------
diff --git a/src/blur-thrift/src/main/java/org/apache/blur/thrift/generated/Selector.java b/src/blur-thrift/src/main/java/org/apache/blur/thrift/generated/Selector.java
index e1a4c5b..323c5ce 100644
--- a/src/blur-thrift/src/main/java/org/apache/blur/thrift/generated/Selector.java
+++ b/src/blur-thrift/src/main/java/org/apache/blur/thrift/generated/Selector.java
@@ -62,6 +62,8 @@ public class Selector implements org.apache.thrift.TBase<Selector, Selector._Fie
   private static final org.apache.thrift.protocol.TField COLUMN_FAMILIES_TO_FETCH_FIELD_DESC = new org.apache.thrift.protocol.TField("columnFamiliesToFetch", org.apache.thrift.protocol.TType.SET, (short)5);
   private static final org.apache.thrift.protocol.TField COLUMNS_TO_FETCH_FIELD_DESC = new org.apache.thrift.protocol.TField("columnsToFetch", org.apache.thrift.protocol.TType.MAP, (short)6);
   private static final org.apache.thrift.protocol.TField ALLOW_STALE_DATA_FIELD_DESC = new org.apache.thrift.protocol.TField("allowStaleData", org.apache.thrift.protocol.TType.BOOL, (short)7);
+  private static final org.apache.thrift.protocol.TField START_RECORD_FIELD_DESC = new org.apache.thrift.protocol.TField("startRecord", org.apache.thrift.protocol.TType.I32, (short)8);
+  private static final org.apache.thrift.protocol.TField MAX_RECORDS_TO_FETCH_FIELD_DESC = new org.apache.thrift.protocol.TField("maxRecordsToFetch", org.apache.thrift.protocol.TType.I32, (short)9);
 
   private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
   static {
@@ -97,6 +99,20 @@ public class Selector implements org.apache.thrift.TBase<Selector, Selector._Fie
    * @deprecated This value is no longer used.  This allows the fetch to see the most current data that has been added to the table.
    */
   public boolean allowStaleData; // required
+  /**
+   * Only valid for Row fetches, the record in the row to start fetching.  If the row contains 1000
+   * records and you want the first 100, then this value is 0.  If you want records 300-400 then this
+   * value would be 300.  If startRecord is beyond the end of the row, the row will be null in the
+   * FetchResult.  Used in conjunction with maxRecordsToFetch.
+   */
+  public int startRecord; // required
+  /**
+   * Only valid for Row fetches, the number of records to fetch.  If the row contains 1000 records
+   * and you want the first 100, then this value is 100.  If you want records 300-400 then this value
+   * would be 100.  Used in conjunction with maxRecordsToFetch. By default this will fetch all the
+   * records in the row, be careful.
+   */
+  public int maxRecordsToFetch; // 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 {
@@ -127,7 +143,21 @@ public class Selector implements org.apache.thrift.TBase<Selector, Selector._Fie
     /**
      * @deprecated This value is no longer used.  This allows the fetch to see the most current data that has been added to the table.
      */
-    ALLOW_STALE_DATA((short)7, "allowStaleData");
+    ALLOW_STALE_DATA((short)7, "allowStaleData"),
+    /**
+     * Only valid for Row fetches, the record in the row to start fetching.  If the row contains 1000
+     * records and you want the first 100, then this value is 0.  If you want records 300-400 then this
+     * value would be 300.  If startRecord is beyond the end of the row, the row will be null in the
+     * FetchResult.  Used in conjunction with maxRecordsToFetch.
+     */
+    START_RECORD((short)8, "startRecord"),
+    /**
+     * Only valid for Row fetches, the number of records to fetch.  If the row contains 1000 records
+     * and you want the first 100, then this value is 100.  If you want records 300-400 then this value
+     * would be 100.  Used in conjunction with maxRecordsToFetch. By default this will fetch all the
+     * records in the row, be careful.
+     */
+    MAX_RECORDS_TO_FETCH((short)9, "maxRecordsToFetch");
 
     private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
 
@@ -156,6 +186,10 @@ public class Selector implements org.apache.thrift.TBase<Selector, Selector._Fie
           return COLUMNS_TO_FETCH;
         case 7: // ALLOW_STALE_DATA
           return ALLOW_STALE_DATA;
+        case 8: // START_RECORD
+          return START_RECORD;
+        case 9: // MAX_RECORDS_TO_FETCH
+          return MAX_RECORDS_TO_FETCH;
         default:
           return null;
       }
@@ -198,6 +232,8 @@ public class Selector implements org.apache.thrift.TBase<Selector, Selector._Fie
   // isset id assignments
   private static final int __RECORDONLY_ISSET_ID = 0;
   private static final int __ALLOWSTALEDATA_ISSET_ID = 1;
+  private static final int __STARTRECORD_ISSET_ID = 2;
+  private static final int __MAXRECORDSTOFETCH_ISSET_ID = 3;
   private byte __isset_bitfield = 0;
   public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
   static {
@@ -220,11 +256,19 @@ public class Selector implements org.apache.thrift.TBase<Selector, Selector._Fie
                 new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))));
     tmpMap.put(_Fields.ALLOW_STALE_DATA, new org.apache.thrift.meta_data.FieldMetaData("allowStaleData", org.apache.thrift.TFieldRequirementType.DEFAULT, 
         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
+    tmpMap.put(_Fields.START_RECORD, new org.apache.thrift.meta_data.FieldMetaData("startRecord", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
+    tmpMap.put(_Fields.MAX_RECORDS_TO_FETCH, new org.apache.thrift.meta_data.FieldMetaData("maxRecordsToFetch", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
     metaDataMap = Collections.unmodifiableMap(tmpMap);
     org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Selector.class, metaDataMap);
   }
 
   public Selector() {
+    this.startRecord = 0;
+
+    this.maxRecordsToFetch = 2147483647;
+
   }
 
   public Selector(
@@ -234,7 +278,9 @@ public class Selector implements org.apache.thrift.TBase<Selector, Selector._Fie
     String recordId,
     Set<String> columnFamiliesToFetch,
     Map<String,Set<String>> columnsToFetch,
-    boolean allowStaleData)
+    boolean allowStaleData,
+    int startRecord,
+    int maxRecordsToFetch)
   {
     this();
     this.recordOnly = recordOnly;
@@ -246,6 +292,10 @@ public class Selector implements org.apache.thrift.TBase<Selector, Selector._Fie
     this.columnsToFetch = columnsToFetch;
     this.allowStaleData = allowStaleData;
     setAllowStaleDataIsSet(true);
+    this.startRecord = startRecord;
+    setStartRecordIsSet(true);
+    this.maxRecordsToFetch = maxRecordsToFetch;
+    setMaxRecordsToFetchIsSet(true);
   }
 
   /**
@@ -289,6 +339,8 @@ public class Selector implements org.apache.thrift.TBase<Selector, Selector._Fie
       this.columnsToFetch = __this__columnsToFetch;
     }
     this.allowStaleData = other.allowStaleData;
+    this.startRecord = other.startRecord;
+    this.maxRecordsToFetch = other.maxRecordsToFetch;
   }
 
   public Selector deepCopy() {
@@ -306,6 +358,10 @@ public class Selector implements org.apache.thrift.TBase<Selector, Selector._Fie
     this.columnsToFetch = null;
     setAllowStaleDataIsSet(false);
     this.allowStaleData = false;
+    this.startRecord = 0;
+
+    this.maxRecordsToFetch = 2147483647;
+
   }
 
   /**
@@ -542,6 +598,76 @@ public class Selector implements org.apache.thrift.TBase<Selector, Selector._Fie
     __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ALLOWSTALEDATA_ISSET_ID, value);
   }
 
+  /**
+   * Only valid for Row fetches, the record in the row to start fetching.  If the row contains 1000
+   * records and you want the first 100, then this value is 0.  If you want records 300-400 then this
+   * value would be 300.  If startRecord is beyond the end of the row, the row will be null in the
+   * FetchResult.  Used in conjunction with maxRecordsToFetch.
+   */
+  public int getStartRecord() {
+    return this.startRecord;
+  }
+
+  /**
+   * Only valid for Row fetches, the record in the row to start fetching.  If the row contains 1000
+   * records and you want the first 100, then this value is 0.  If you want records 300-400 then this
+   * value would be 300.  If startRecord is beyond the end of the row, the row will be null in the
+   * FetchResult.  Used in conjunction with maxRecordsToFetch.
+   */
+  public Selector setStartRecord(int startRecord) {
+    this.startRecord = startRecord;
+    setStartRecordIsSet(true);
+    return this;
+  }
+
+  public void unsetStartRecord() {
+    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __STARTRECORD_ISSET_ID);
+  }
+
+  /** Returns true if field startRecord is set (has been assigned a value) and false otherwise */
+  public boolean isSetStartRecord() {
+    return EncodingUtils.testBit(__isset_bitfield, __STARTRECORD_ISSET_ID);
+  }
+
+  public void setStartRecordIsSet(boolean value) {
+    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __STARTRECORD_ISSET_ID, value);
+  }
+
+  /**
+   * Only valid for Row fetches, the number of records to fetch.  If the row contains 1000 records
+   * and you want the first 100, then this value is 100.  If you want records 300-400 then this value
+   * would be 100.  Used in conjunction with maxRecordsToFetch. By default this will fetch all the
+   * records in the row, be careful.
+   */
+  public int getMaxRecordsToFetch() {
+    return this.maxRecordsToFetch;
+  }
+
+  /**
+   * Only valid for Row fetches, the number of records to fetch.  If the row contains 1000 records
+   * and you want the first 100, then this value is 100.  If you want records 300-400 then this value
+   * would be 100.  Used in conjunction with maxRecordsToFetch. By default this will fetch all the
+   * records in the row, be careful.
+   */
+  public Selector setMaxRecordsToFetch(int maxRecordsToFetch) {
+    this.maxRecordsToFetch = maxRecordsToFetch;
+    setMaxRecordsToFetchIsSet(true);
+    return this;
+  }
+
+  public void unsetMaxRecordsToFetch() {
+    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __MAXRECORDSTOFETCH_ISSET_ID);
+  }
+
+  /** Returns true if field maxRecordsToFetch is set (has been assigned a value) and false otherwise */
+  public boolean isSetMaxRecordsToFetch() {
+    return EncodingUtils.testBit(__isset_bitfield, __MAXRECORDSTOFETCH_ISSET_ID);
+  }
+
+  public void setMaxRecordsToFetchIsSet(boolean value) {
+    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __MAXRECORDSTOFETCH_ISSET_ID, value);
+  }
+
   public void setFieldValue(_Fields field, Object value) {
     switch (field) {
     case RECORD_ONLY:
@@ -600,6 +726,22 @@ public class Selector implements org.apache.thrift.TBase<Selector, Selector._Fie
       }
       break;
 
+    case START_RECORD:
+      if (value == null) {
+        unsetStartRecord();
+      } else {
+        setStartRecord((Integer)value);
+      }
+      break;
+
+    case MAX_RECORDS_TO_FETCH:
+      if (value == null) {
+        unsetMaxRecordsToFetch();
+      } else {
+        setMaxRecordsToFetch((Integer)value);
+      }
+      break;
+
     }
   }
 
@@ -626,6 +768,12 @@ public class Selector implements org.apache.thrift.TBase<Selector, Selector._Fie
     case ALLOW_STALE_DATA:
       return Boolean.valueOf(isAllowStaleData());
 
+    case START_RECORD:
+      return Integer.valueOf(getStartRecord());
+
+    case MAX_RECORDS_TO_FETCH:
+      return Integer.valueOf(getMaxRecordsToFetch());
+
     }
     throw new IllegalStateException();
   }
@@ -651,6 +799,10 @@ public class Selector implements org.apache.thrift.TBase<Selector, Selector._Fie
       return isSetColumnsToFetch();
     case ALLOW_STALE_DATA:
       return isSetAllowStaleData();
+    case START_RECORD:
+      return isSetStartRecord();
+    case MAX_RECORDS_TO_FETCH:
+      return isSetMaxRecordsToFetch();
     }
     throw new IllegalStateException();
   }
@@ -731,6 +883,24 @@ public class Selector implements org.apache.thrift.TBase<Selector, Selector._Fie
         return false;
     }
 
+    boolean this_present_startRecord = true;
+    boolean that_present_startRecord = true;
+    if (this_present_startRecord || that_present_startRecord) {
+      if (!(this_present_startRecord && that_present_startRecord))
+        return false;
+      if (this.startRecord != that.startRecord)
+        return false;
+    }
+
+    boolean this_present_maxRecordsToFetch = true;
+    boolean that_present_maxRecordsToFetch = true;
+    if (this_present_maxRecordsToFetch || that_present_maxRecordsToFetch) {
+      if (!(this_present_maxRecordsToFetch && that_present_maxRecordsToFetch))
+        return false;
+      if (this.maxRecordsToFetch != that.maxRecordsToFetch)
+        return false;
+    }
+
     return true;
   }
 
@@ -817,6 +987,26 @@ public class Selector implements org.apache.thrift.TBase<Selector, Selector._Fie
         return lastComparison;
       }
     }
+    lastComparison = Boolean.valueOf(isSetStartRecord()).compareTo(typedOther.isSetStartRecord());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetStartRecord()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.startRecord, typedOther.startRecord);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    lastComparison = Boolean.valueOf(isSetMaxRecordsToFetch()).compareTo(typedOther.isSetMaxRecordsToFetch());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetMaxRecordsToFetch()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.maxRecordsToFetch, typedOther.maxRecordsToFetch);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
     return 0;
   }
 
@@ -884,6 +1074,14 @@ public class Selector implements org.apache.thrift.TBase<Selector, Selector._Fie
     sb.append("allowStaleData:");
     sb.append(this.allowStaleData);
     first = false;
+    if (!first) sb.append(", ");
+    sb.append("startRecord:");
+    sb.append(this.startRecord);
+    first = false;
+    if (!first) sb.append(", ");
+    sb.append("maxRecordsToFetch:");
+    sb.append(this.maxRecordsToFetch);
+    first = false;
     sb.append(")");
     return sb.toString();
   }
@@ -1017,6 +1215,22 @@ public class Selector implements org.apache.thrift.TBase<Selector, Selector._Fie
               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
             }
             break;
+          case 8: // START_RECORD
+            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
+              struct.startRecord = iprot.readI32();
+              struct.setStartRecordIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 9: // MAX_RECORDS_TO_FETCH
+            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
+              struct.maxRecordsToFetch = iprot.readI32();
+              struct.setMaxRecordsToFetchIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
           default:
             org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
@@ -1085,6 +1299,12 @@ public class Selector implements org.apache.thrift.TBase<Selector, Selector._Fie
       oprot.writeFieldBegin(ALLOW_STALE_DATA_FIELD_DESC);
       oprot.writeBool(struct.allowStaleData);
       oprot.writeFieldEnd();
+      oprot.writeFieldBegin(START_RECORD_FIELD_DESC);
+      oprot.writeI32(struct.startRecord);
+      oprot.writeFieldEnd();
+      oprot.writeFieldBegin(MAX_RECORDS_TO_FETCH_FIELD_DESC);
+      oprot.writeI32(struct.maxRecordsToFetch);
+      oprot.writeFieldEnd();
       oprot.writeFieldStop();
       oprot.writeStructEnd();
     }
@@ -1124,7 +1344,13 @@ public class Selector implements org.apache.thrift.TBase<Selector, Selector._Fie
       if (struct.isSetAllowStaleData()) {
         optionals.set(6);
       }
-      oprot.writeBitSet(optionals, 7);
+      if (struct.isSetStartRecord()) {
+        optionals.set(7);
+      }
+      if (struct.isSetMaxRecordsToFetch()) {
+        optionals.set(8);
+      }
+      oprot.writeBitSet(optionals, 9);
       if (struct.isSetRecordOnly()) {
         oprot.writeBool(struct.recordOnly);
       }
@@ -1165,12 +1391,18 @@ public class Selector implements org.apache.thrift.TBase<Selector, Selector._Fie
       if (struct.isSetAllowStaleData()) {
         oprot.writeBool(struct.allowStaleData);
       }
+      if (struct.isSetStartRecord()) {
+        oprot.writeI32(struct.startRecord);
+      }
+      if (struct.isSetMaxRecordsToFetch()) {
+        oprot.writeI32(struct.maxRecordsToFetch);
+      }
     }
 
     @Override
     public void read(org.apache.thrift.protocol.TProtocol prot, Selector struct) throws org.apache.thrift.TException {
       TTupleProtocol iprot = (TTupleProtocol) prot;
-      BitSet incoming = iprot.readBitSet(7);
+      BitSet incoming = iprot.readBitSet(9);
       if (incoming.get(0)) {
         struct.recordOnly = iprot.readBool();
         struct.setRecordOnlyIsSet(true);
@@ -1228,6 +1460,14 @@ public class Selector implements org.apache.thrift.TBase<Selector, Selector._Fie
         struct.allowStaleData = iprot.readBool();
         struct.setAllowStaleDataIsSet(true);
       }
+      if (incoming.get(7)) {
+        struct.startRecord = iprot.readI32();
+        struct.setStartRecordIsSet(true);
+      }
+      if (incoming.get(8)) {
+        struct.maxRecordsToFetch = iprot.readI32();
+        struct.setMaxRecordsToFetchIsSet(true);
+      }
     }
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/09125a39/src/distribution/src/main/scripts/interface/Blur.thrift
----------------------------------------------------------------------
diff --git a/src/distribution/src/main/scripts/interface/Blur.thrift b/src/distribution/src/main/scripts/interface/Blur.thrift
index 24bb098..807d2c7 100644
--- a/src/distribution/src/main/scripts/interface/Blur.thrift
+++ b/src/distribution/src/main/scripts/interface/Blur.thrift
@@ -189,7 +189,21 @@ struct Selector {
   /**
    * @deprecated This value is no longer used.  This allows the fetch to see the most current data that has been added to the table.
    */
-  7:bool allowStaleData
+  7:bool allowStaleData,
+  /**
+   * Only valid for Row fetches, the record in the row to start fetching.  If the row contains 1000 
+   * records and you want the first 100, then this value is 0.  If you want records 300-400 then this 
+   * value would be 300.  If startRecord is beyond the end of the row, the row will be null in the 
+   * FetchResult.  Used in conjunction with maxRecordsToFetch.
+   */
+  8:i32 startRecord = 0,
+  /**
+   * Only valid for Row fetches, the number of records to fetch.  If the row contains 1000 records 
+   * and you want the first 100, then this value is 100.  If you want records 300-400 then this value 
+   * would be 100.  Used in conjunction with maxRecordsToFetch. By default this will fetch all the 
+   * records in the row, be careful.
+   */
+  9:i32 maxRecordsToFetch = 2147483647
 }
 
 /**

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/09125a39/src/distribution/src/main/scripts/interface/gen-html/Blur.html
----------------------------------------------------------------------
diff --git a/src/distribution/src/main/scripts/interface/gen-html/Blur.html b/src/distribution/src/main/scripts/interface/gen-html/Blur.html
index ec3d94f..08721be 100644
--- a/src/distribution/src/main/scripts/interface/gen-html/Blur.html
+++ b/src/distribution/src/main/scripts/interface/gen-html/Blur.html
@@ -182,6 +182,16 @@ through records of a row, this count will reflect the entire row.
 </td><td>default</td><td></td></tr>
 <tr><td>7</td><td>allowStaleData</td><td><code>bool</code></td><td>@deprecated This value is no longer used.  This allows the fetch to see the most current data that has been added to the table.
 </td><td>default</td><td></td></tr>
+<tr><td>8</td><td>startRecord</td><td><code>i32</code></td><td>Only valid for Row fetches, the record in the row to start fetching.  If the row contains 1000
+records and you want the first 100, then this value is 0.  If you want records 300-400 then this
+value would be 300.  If startRecord is beyond the end of the row, the row will be null in the
+FetchResult.  Used in conjunction with maxRecordsToFetch.
+</td><td>default</td><td>0</td></tr>
+<tr><td>9</td><td>maxRecordsToFetch</td><td><code>i32</code></td><td>Only valid for Row fetches, the number of records to fetch.  If the row contains 1000 records
+and you want the first 100, then this value is 100.  If you want records 300-400 then this value
+would be 100.  Used in conjunction with maxRecordsToFetch. By default this will fetch all the
+records in the row, be careful.
+</td><td>default</td><td>2147483647</td></tr>
 </table><br/>Select carries the request for information to be retrieved from the stored columns.
 <br/></div><div class="definition"><h3 id="Struct_FetchRowResult">Struct: FetchRowResult</h3>
 <table class="table-bordered table-striped table-condensed"><thead><th>Key</th><th>Field</th><th>Type</th><th>Description</th><th>Requiredness</th><th>Default value</th></thead>

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/09125a39/src/distribution/src/main/scripts/interface/gen-java/org/apache/blur/thrift/generated/Selector.java
----------------------------------------------------------------------
diff --git a/src/distribution/src/main/scripts/interface/gen-java/org/apache/blur/thrift/generated/Selector.java b/src/distribution/src/main/scripts/interface/gen-java/org/apache/blur/thrift/generated/Selector.java
index e1a4c5b..323c5ce 100644
--- a/src/distribution/src/main/scripts/interface/gen-java/org/apache/blur/thrift/generated/Selector.java
+++ b/src/distribution/src/main/scripts/interface/gen-java/org/apache/blur/thrift/generated/Selector.java
@@ -62,6 +62,8 @@ public class Selector implements org.apache.thrift.TBase<Selector, Selector._Fie
   private static final org.apache.thrift.protocol.TField COLUMN_FAMILIES_TO_FETCH_FIELD_DESC = new org.apache.thrift.protocol.TField("columnFamiliesToFetch", org.apache.thrift.protocol.TType.SET, (short)5);
   private static final org.apache.thrift.protocol.TField COLUMNS_TO_FETCH_FIELD_DESC = new org.apache.thrift.protocol.TField("columnsToFetch", org.apache.thrift.protocol.TType.MAP, (short)6);
   private static final org.apache.thrift.protocol.TField ALLOW_STALE_DATA_FIELD_DESC = new org.apache.thrift.protocol.TField("allowStaleData", org.apache.thrift.protocol.TType.BOOL, (short)7);
+  private static final org.apache.thrift.protocol.TField START_RECORD_FIELD_DESC = new org.apache.thrift.protocol.TField("startRecord", org.apache.thrift.protocol.TType.I32, (short)8);
+  private static final org.apache.thrift.protocol.TField MAX_RECORDS_TO_FETCH_FIELD_DESC = new org.apache.thrift.protocol.TField("maxRecordsToFetch", org.apache.thrift.protocol.TType.I32, (short)9);
 
   private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
   static {
@@ -97,6 +99,20 @@ public class Selector implements org.apache.thrift.TBase<Selector, Selector._Fie
    * @deprecated This value is no longer used.  This allows the fetch to see the most current data that has been added to the table.
    */
   public boolean allowStaleData; // required
+  /**
+   * Only valid for Row fetches, the record in the row to start fetching.  If the row contains 1000
+   * records and you want the first 100, then this value is 0.  If you want records 300-400 then this
+   * value would be 300.  If startRecord is beyond the end of the row, the row will be null in the
+   * FetchResult.  Used in conjunction with maxRecordsToFetch.
+   */
+  public int startRecord; // required
+  /**
+   * Only valid for Row fetches, the number of records to fetch.  If the row contains 1000 records
+   * and you want the first 100, then this value is 100.  If you want records 300-400 then this value
+   * would be 100.  Used in conjunction with maxRecordsToFetch. By default this will fetch all the
+   * records in the row, be careful.
+   */
+  public int maxRecordsToFetch; // 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 {
@@ -127,7 +143,21 @@ public class Selector implements org.apache.thrift.TBase<Selector, Selector._Fie
     /**
      * @deprecated This value is no longer used.  This allows the fetch to see the most current data that has been added to the table.
      */
-    ALLOW_STALE_DATA((short)7, "allowStaleData");
+    ALLOW_STALE_DATA((short)7, "allowStaleData"),
+    /**
+     * Only valid for Row fetches, the record in the row to start fetching.  If the row contains 1000
+     * records and you want the first 100, then this value is 0.  If you want records 300-400 then this
+     * value would be 300.  If startRecord is beyond the end of the row, the row will be null in the
+     * FetchResult.  Used in conjunction with maxRecordsToFetch.
+     */
+    START_RECORD((short)8, "startRecord"),
+    /**
+     * Only valid for Row fetches, the number of records to fetch.  If the row contains 1000 records
+     * and you want the first 100, then this value is 100.  If you want records 300-400 then this value
+     * would be 100.  Used in conjunction with maxRecordsToFetch. By default this will fetch all the
+     * records in the row, be careful.
+     */
+    MAX_RECORDS_TO_FETCH((short)9, "maxRecordsToFetch");
 
     private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
 
@@ -156,6 +186,10 @@ public class Selector implements org.apache.thrift.TBase<Selector, Selector._Fie
           return COLUMNS_TO_FETCH;
         case 7: // ALLOW_STALE_DATA
           return ALLOW_STALE_DATA;
+        case 8: // START_RECORD
+          return START_RECORD;
+        case 9: // MAX_RECORDS_TO_FETCH
+          return MAX_RECORDS_TO_FETCH;
         default:
           return null;
       }
@@ -198,6 +232,8 @@ public class Selector implements org.apache.thrift.TBase<Selector, Selector._Fie
   // isset id assignments
   private static final int __RECORDONLY_ISSET_ID = 0;
   private static final int __ALLOWSTALEDATA_ISSET_ID = 1;
+  private static final int __STARTRECORD_ISSET_ID = 2;
+  private static final int __MAXRECORDSTOFETCH_ISSET_ID = 3;
   private byte __isset_bitfield = 0;
   public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
   static {
@@ -220,11 +256,19 @@ public class Selector implements org.apache.thrift.TBase<Selector, Selector._Fie
                 new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))));
     tmpMap.put(_Fields.ALLOW_STALE_DATA, new org.apache.thrift.meta_data.FieldMetaData("allowStaleData", org.apache.thrift.TFieldRequirementType.DEFAULT, 
         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
+    tmpMap.put(_Fields.START_RECORD, new org.apache.thrift.meta_data.FieldMetaData("startRecord", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
+    tmpMap.put(_Fields.MAX_RECORDS_TO_FETCH, new org.apache.thrift.meta_data.FieldMetaData("maxRecordsToFetch", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
     metaDataMap = Collections.unmodifiableMap(tmpMap);
     org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Selector.class, metaDataMap);
   }
 
   public Selector() {
+    this.startRecord = 0;
+
+    this.maxRecordsToFetch = 2147483647;
+
   }
 
   public Selector(
@@ -234,7 +278,9 @@ public class Selector implements org.apache.thrift.TBase<Selector, Selector._Fie
     String recordId,
     Set<String> columnFamiliesToFetch,
     Map<String,Set<String>> columnsToFetch,
-    boolean allowStaleData)
+    boolean allowStaleData,
+    int startRecord,
+    int maxRecordsToFetch)
   {
     this();
     this.recordOnly = recordOnly;
@@ -246,6 +292,10 @@ public class Selector implements org.apache.thrift.TBase<Selector, Selector._Fie
     this.columnsToFetch = columnsToFetch;
     this.allowStaleData = allowStaleData;
     setAllowStaleDataIsSet(true);
+    this.startRecord = startRecord;
+    setStartRecordIsSet(true);
+    this.maxRecordsToFetch = maxRecordsToFetch;
+    setMaxRecordsToFetchIsSet(true);
   }
 
   /**
@@ -289,6 +339,8 @@ public class Selector implements org.apache.thrift.TBase<Selector, Selector._Fie
       this.columnsToFetch = __this__columnsToFetch;
     }
     this.allowStaleData = other.allowStaleData;
+    this.startRecord = other.startRecord;
+    this.maxRecordsToFetch = other.maxRecordsToFetch;
   }
 
   public Selector deepCopy() {
@@ -306,6 +358,10 @@ public class Selector implements org.apache.thrift.TBase<Selector, Selector._Fie
     this.columnsToFetch = null;
     setAllowStaleDataIsSet(false);
     this.allowStaleData = false;
+    this.startRecord = 0;
+
+    this.maxRecordsToFetch = 2147483647;
+
   }
 
   /**
@@ -542,6 +598,76 @@ public class Selector implements org.apache.thrift.TBase<Selector, Selector._Fie
     __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ALLOWSTALEDATA_ISSET_ID, value);
   }
 
+  /**
+   * Only valid for Row fetches, the record in the row to start fetching.  If the row contains 1000
+   * records and you want the first 100, then this value is 0.  If you want records 300-400 then this
+   * value would be 300.  If startRecord is beyond the end of the row, the row will be null in the
+   * FetchResult.  Used in conjunction with maxRecordsToFetch.
+   */
+  public int getStartRecord() {
+    return this.startRecord;
+  }
+
+  /**
+   * Only valid for Row fetches, the record in the row to start fetching.  If the row contains 1000
+   * records and you want the first 100, then this value is 0.  If you want records 300-400 then this
+   * value would be 300.  If startRecord is beyond the end of the row, the row will be null in the
+   * FetchResult.  Used in conjunction with maxRecordsToFetch.
+   */
+  public Selector setStartRecord(int startRecord) {
+    this.startRecord = startRecord;
+    setStartRecordIsSet(true);
+    return this;
+  }
+
+  public void unsetStartRecord() {
+    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __STARTRECORD_ISSET_ID);
+  }
+
+  /** Returns true if field startRecord is set (has been assigned a value) and false otherwise */
+  public boolean isSetStartRecord() {
+    return EncodingUtils.testBit(__isset_bitfield, __STARTRECORD_ISSET_ID);
+  }
+
+  public void setStartRecordIsSet(boolean value) {
+    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __STARTRECORD_ISSET_ID, value);
+  }
+
+  /**
+   * Only valid for Row fetches, the number of records to fetch.  If the row contains 1000 records
+   * and you want the first 100, then this value is 100.  If you want records 300-400 then this value
+   * would be 100.  Used in conjunction with maxRecordsToFetch. By default this will fetch all the
+   * records in the row, be careful.
+   */
+  public int getMaxRecordsToFetch() {
+    return this.maxRecordsToFetch;
+  }
+
+  /**
+   * Only valid for Row fetches, the number of records to fetch.  If the row contains 1000 records
+   * and you want the first 100, then this value is 100.  If you want records 300-400 then this value
+   * would be 100.  Used in conjunction with maxRecordsToFetch. By default this will fetch all the
+   * records in the row, be careful.
+   */
+  public Selector setMaxRecordsToFetch(int maxRecordsToFetch) {
+    this.maxRecordsToFetch = maxRecordsToFetch;
+    setMaxRecordsToFetchIsSet(true);
+    return this;
+  }
+
+  public void unsetMaxRecordsToFetch() {
+    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __MAXRECORDSTOFETCH_ISSET_ID);
+  }
+
+  /** Returns true if field maxRecordsToFetch is set (has been assigned a value) and false otherwise */
+  public boolean isSetMaxRecordsToFetch() {
+    return EncodingUtils.testBit(__isset_bitfield, __MAXRECORDSTOFETCH_ISSET_ID);
+  }
+
+  public void setMaxRecordsToFetchIsSet(boolean value) {
+    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __MAXRECORDSTOFETCH_ISSET_ID, value);
+  }
+
   public void setFieldValue(_Fields field, Object value) {
     switch (field) {
     case RECORD_ONLY:
@@ -600,6 +726,22 @@ public class Selector implements org.apache.thrift.TBase<Selector, Selector._Fie
       }
       break;
 
+    case START_RECORD:
+      if (value == null) {
+        unsetStartRecord();
+      } else {
+        setStartRecord((Integer)value);
+      }
+      break;
+
+    case MAX_RECORDS_TO_FETCH:
+      if (value == null) {
+        unsetMaxRecordsToFetch();
+      } else {
+        setMaxRecordsToFetch((Integer)value);
+      }
+      break;
+
     }
   }
 
@@ -626,6 +768,12 @@ public class Selector implements org.apache.thrift.TBase<Selector, Selector._Fie
     case ALLOW_STALE_DATA:
       return Boolean.valueOf(isAllowStaleData());
 
+    case START_RECORD:
+      return Integer.valueOf(getStartRecord());
+
+    case MAX_RECORDS_TO_FETCH:
+      return Integer.valueOf(getMaxRecordsToFetch());
+
     }
     throw new IllegalStateException();
   }
@@ -651,6 +799,10 @@ public class Selector implements org.apache.thrift.TBase<Selector, Selector._Fie
       return isSetColumnsToFetch();
     case ALLOW_STALE_DATA:
       return isSetAllowStaleData();
+    case START_RECORD:
+      return isSetStartRecord();
+    case MAX_RECORDS_TO_FETCH:
+      return isSetMaxRecordsToFetch();
     }
     throw new IllegalStateException();
   }
@@ -731,6 +883,24 @@ public class Selector implements org.apache.thrift.TBase<Selector, Selector._Fie
         return false;
     }
 
+    boolean this_present_startRecord = true;
+    boolean that_present_startRecord = true;
+    if (this_present_startRecord || that_present_startRecord) {
+      if (!(this_present_startRecord && that_present_startRecord))
+        return false;
+      if (this.startRecord != that.startRecord)
+        return false;
+    }
+
+    boolean this_present_maxRecordsToFetch = true;
+    boolean that_present_maxRecordsToFetch = true;
+    if (this_present_maxRecordsToFetch || that_present_maxRecordsToFetch) {
+      if (!(this_present_maxRecordsToFetch && that_present_maxRecordsToFetch))
+        return false;
+      if (this.maxRecordsToFetch != that.maxRecordsToFetch)
+        return false;
+    }
+
     return true;
   }
 
@@ -817,6 +987,26 @@ public class Selector implements org.apache.thrift.TBase<Selector, Selector._Fie
         return lastComparison;
       }
     }
+    lastComparison = Boolean.valueOf(isSetStartRecord()).compareTo(typedOther.isSetStartRecord());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetStartRecord()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.startRecord, typedOther.startRecord);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    lastComparison = Boolean.valueOf(isSetMaxRecordsToFetch()).compareTo(typedOther.isSetMaxRecordsToFetch());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetMaxRecordsToFetch()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.maxRecordsToFetch, typedOther.maxRecordsToFetch);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
     return 0;
   }
 
@@ -884,6 +1074,14 @@ public class Selector implements org.apache.thrift.TBase<Selector, Selector._Fie
     sb.append("allowStaleData:");
     sb.append(this.allowStaleData);
     first = false;
+    if (!first) sb.append(", ");
+    sb.append("startRecord:");
+    sb.append(this.startRecord);
+    first = false;
+    if (!first) sb.append(", ");
+    sb.append("maxRecordsToFetch:");
+    sb.append(this.maxRecordsToFetch);
+    first = false;
     sb.append(")");
     return sb.toString();
   }
@@ -1017,6 +1215,22 @@ public class Selector implements org.apache.thrift.TBase<Selector, Selector._Fie
               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
             }
             break;
+          case 8: // START_RECORD
+            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
+              struct.startRecord = iprot.readI32();
+              struct.setStartRecordIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 9: // MAX_RECORDS_TO_FETCH
+            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
+              struct.maxRecordsToFetch = iprot.readI32();
+              struct.setMaxRecordsToFetchIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
           default:
             org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
@@ -1085,6 +1299,12 @@ public class Selector implements org.apache.thrift.TBase<Selector, Selector._Fie
       oprot.writeFieldBegin(ALLOW_STALE_DATA_FIELD_DESC);
       oprot.writeBool(struct.allowStaleData);
       oprot.writeFieldEnd();
+      oprot.writeFieldBegin(START_RECORD_FIELD_DESC);
+      oprot.writeI32(struct.startRecord);
+      oprot.writeFieldEnd();
+      oprot.writeFieldBegin(MAX_RECORDS_TO_FETCH_FIELD_DESC);
+      oprot.writeI32(struct.maxRecordsToFetch);
+      oprot.writeFieldEnd();
       oprot.writeFieldStop();
       oprot.writeStructEnd();
     }
@@ -1124,7 +1344,13 @@ public class Selector implements org.apache.thrift.TBase<Selector, Selector._Fie
       if (struct.isSetAllowStaleData()) {
         optionals.set(6);
       }
-      oprot.writeBitSet(optionals, 7);
+      if (struct.isSetStartRecord()) {
+        optionals.set(7);
+      }
+      if (struct.isSetMaxRecordsToFetch()) {
+        optionals.set(8);
+      }
+      oprot.writeBitSet(optionals, 9);
       if (struct.isSetRecordOnly()) {
         oprot.writeBool(struct.recordOnly);
       }
@@ -1165,12 +1391,18 @@ public class Selector implements org.apache.thrift.TBase<Selector, Selector._Fie
       if (struct.isSetAllowStaleData()) {
         oprot.writeBool(struct.allowStaleData);
       }
+      if (struct.isSetStartRecord()) {
+        oprot.writeI32(struct.startRecord);
+      }
+      if (struct.isSetMaxRecordsToFetch()) {
+        oprot.writeI32(struct.maxRecordsToFetch);
+      }
     }
 
     @Override
     public void read(org.apache.thrift.protocol.TProtocol prot, Selector struct) throws org.apache.thrift.TException {
       TTupleProtocol iprot = (TTupleProtocol) prot;
-      BitSet incoming = iprot.readBitSet(7);
+      BitSet incoming = iprot.readBitSet(9);
       if (incoming.get(0)) {
         struct.recordOnly = iprot.readBool();
         struct.setRecordOnlyIsSet(true);
@@ -1228,6 +1460,14 @@ public class Selector implements org.apache.thrift.TBase<Selector, Selector._Fie
         struct.allowStaleData = iprot.readBool();
         struct.setAllowStaleDataIsSet(true);
       }
+      if (incoming.get(7)) {
+        struct.startRecord = iprot.readI32();
+        struct.setStartRecordIsSet(true);
+      }
+      if (incoming.get(8)) {
+        struct.maxRecordsToFetch = iprot.readI32();
+        struct.setMaxRecordsToFetchIsSet(true);
+      }
     }
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/09125a39/src/distribution/src/main/scripts/interface/gen-js/Blur_types.js
----------------------------------------------------------------------
diff --git a/src/distribution/src/main/scripts/interface/gen-js/Blur_types.js b/src/distribution/src/main/scripts/interface/gen-js/Blur_types.js
index 622d1e2..375b4cb 100644
--- a/src/distribution/src/main/scripts/interface/gen-js/Blur_types.js
+++ b/src/distribution/src/main/scripts/interface/gen-js/Blur_types.js
@@ -385,6 +385,8 @@ Selector = function(args) {
   this.columnFamiliesToFetch = null;
   this.columnsToFetch = null;
   this.allowStaleData = null;
+  this.startRecord = 0;
+  this.maxRecordsToFetch = 2147483647;
   if (args) {
     if (args.recordOnly !== undefined) {
       this.recordOnly = args.recordOnly;
@@ -407,6 +409,12 @@ Selector = function(args) {
     if (args.allowStaleData !== undefined) {
       this.allowStaleData = args.allowStaleData;
     }
+    if (args.startRecord !== undefined) {
+      this.startRecord = args.startRecord;
+    }
+    if (args.maxRecordsToFetch !== undefined) {
+      this.maxRecordsToFetch = args.maxRecordsToFetch;
+    }
   }
 };
 Selector.prototype = {};
@@ -520,6 +528,20 @@ Selector.prototype.read = function(input) {
         input.skip(ftype);
       }
       break;
+      case 8:
+      if (ftype == Thrift.Type.I32) {
+        this.startRecord = input.readI32().value;
+      } else {
+        input.skip(ftype);
+      }
+      break;
+      case 9:
+      if (ftype == Thrift.Type.I32) {
+        this.maxRecordsToFetch = input.readI32().value;
+      } else {
+        input.skip(ftype);
+      }
+      break;
       default:
         input.skip(ftype);
     }
@@ -594,6 +616,16 @@ Selector.prototype.write = function(output) {
     output.writeBool(this.allowStaleData);
     output.writeFieldEnd();
   }
+  if (this.startRecord !== null && this.startRecord !== undefined) {
+    output.writeFieldBegin('startRecord', Thrift.Type.I32, 8);
+    output.writeI32(this.startRecord);
+    output.writeFieldEnd();
+  }
+  if (this.maxRecordsToFetch !== null && this.maxRecordsToFetch !== undefined) {
+    output.writeFieldBegin('maxRecordsToFetch', Thrift.Type.I32, 9);
+    output.writeI32(this.maxRecordsToFetch);
+    output.writeFieldEnd();
+  }
   output.writeFieldStop();
   output.writeStructEnd();
   return;

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/09125a39/src/distribution/src/main/scripts/interface/gen-perl/Blur/Types.pm
----------------------------------------------------------------------
diff --git a/src/distribution/src/main/scripts/interface/gen-perl/Blur/Types.pm b/src/distribution/src/main/scripts/interface/gen-perl/Blur/Types.pm
index 61f627d..0fb2e82 100644
--- a/src/distribution/src/main/scripts/interface/gen-perl/Blur/Types.pm
+++ b/src/distribution/src/main/scripts/interface/gen-perl/Blur/Types.pm
@@ -426,7 +426,7 @@ sub write {
 
 package Blur::Selector;
 use base qw(Class::Accessor);
-Blur::Selector->mk_accessors( qw( recordOnly locationId rowId recordId columnFamiliesToFetch columnsToFetch allowStaleData ) );
+Blur::Selector->mk_accessors( qw( recordOnly locationId rowId recordId columnFamiliesToFetch columnsToFetch allowStaleData startRecord maxRecordsToFetch ) );
 
 sub new {
   my $classname = shift;
@@ -439,6 +439,8 @@ sub new {
   $self->{columnFamiliesToFetch} = undef;
   $self->{columnsToFetch} = undef;
   $self->{allowStaleData} = undef;
+  $self->{startRecord} = 0;
+  $self->{maxRecordsToFetch} = 2147483647;
   if (UNIVERSAL::isa($vals,'HASH')) {
     if (defined $vals->{recordOnly}) {
       $self->{recordOnly} = $vals->{recordOnly};
@@ -461,6 +463,12 @@ sub new {
     if (defined $vals->{allowStaleData}) {
       $self->{allowStaleData} = $vals->{allowStaleData};
     }
+    if (defined $vals->{startRecord}) {
+      $self->{startRecord} = $vals->{startRecord};
+    }
+    if (defined $vals->{maxRecordsToFetch}) {
+      $self->{maxRecordsToFetch} = $vals->{maxRecordsToFetch};
+    }
   }
   return bless ($self, $classname);
 }
@@ -565,6 +573,18 @@ sub read {
         $xfer += $input->skip($ftype);
       }
       last; };
+      /^8$/ && do{      if ($ftype == TType::I32) {
+        $xfer += $input->readI32(\$self->{startRecord});
+      } else {
+        $xfer += $input->skip($ftype);
+      }
+      last; };
+      /^9$/ && do{      if ($ftype == TType::I32) {
+        $xfer += $input->readI32(\$self->{maxRecordsToFetch});
+      } else {
+        $xfer += $input->skip($ftype);
+      }
+      last; };
         $xfer += $input->skip($ftype);
     }
     $xfer += $input->readFieldEnd();
@@ -640,6 +660,16 @@ sub write {
     $xfer += $output->writeBool($self->{allowStaleData});
     $xfer += $output->writeFieldEnd();
   }
+  if (defined $self->{startRecord}) {
+    $xfer += $output->writeFieldBegin('startRecord', TType::I32, 8);
+    $xfer += $output->writeI32($self->{startRecord});
+    $xfer += $output->writeFieldEnd();
+  }
+  if (defined $self->{maxRecordsToFetch}) {
+    $xfer += $output->writeFieldBegin('maxRecordsToFetch', TType::I32, 9);
+    $xfer += $output->writeI32($self->{maxRecordsToFetch});
+    $xfer += $output->writeFieldEnd();
+  }
   $xfer += $output->writeFieldStop();
   $xfer += $output->writeStructEnd();
   return $xfer;

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/09125a39/src/distribution/src/main/scripts/interface/gen-rb/blur_types.rb
----------------------------------------------------------------------
diff --git a/src/distribution/src/main/scripts/interface/gen-rb/blur_types.rb b/src/distribution/src/main/scripts/interface/gen-rb/blur_types.rb
index a8e451c..13d2ace 100644
--- a/src/distribution/src/main/scripts/interface/gen-rb/blur_types.rb
+++ b/src/distribution/src/main/scripts/interface/gen-rb/blur_types.rb
@@ -155,6 +155,8 @@ module Blur
     COLUMNFAMILIESTOFETCH = 5
     COLUMNSTOFETCH = 6
     ALLOWSTALEDATA = 7
+    STARTRECORD = 8
+    MAXRECORDSTOFETCH = 9
 
     FIELDS = {
       # Fetch the Record only, not the entire Row.
@@ -170,7 +172,17 @@ module Blur
       # The columns in the families to fetch.  If null, fetch all.  If empty, fetch none.
       COLUMNSTOFETCH => {:type => ::Thrift::Types::MAP, :name => 'columnsToFetch', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::SET, :element => {:type => ::Thrift::Types::STRING}}},
       # @deprecated This value is no longer used.  This allows the fetch to see the most current data that has been added to the table.
-      ALLOWSTALEDATA => {:type => ::Thrift::Types::BOOL, :name => 'allowStaleData'}
+      ALLOWSTALEDATA => {:type => ::Thrift::Types::BOOL, :name => 'allowStaleData'},
+      # Only valid for Row fetches, the record in the row to start fetching.  If the row contains 1000
+# records and you want the first 100, then this value is 0.  If you want records 300-400 then this
+# value would be 300.  If startRecord is beyond the end of the row, the row will be null in the
+# FetchResult.  Used in conjunction with maxRecordsToFetch.
+      STARTRECORD => {:type => ::Thrift::Types::I32, :name => 'startRecord', :default => 0},
+      # Only valid for Row fetches, the number of records to fetch.  If the row contains 1000 records
+# and you want the first 100, then this value is 100.  If you want records 300-400 then this value
+# would be 100.  Used in conjunction with maxRecordsToFetch. By default this will fetch all the
+# records in the row, be careful.
+      MAXRECORDSTOFETCH => {:type => ::Thrift::Types::I32, :name => 'maxRecordsToFetch', :default => 2147483647}
     }
 
     def struct_fields; FIELDS; end


Mime
View raw message