@Override
 public void nextFrame(ByteBuffer buffer) throws HyracksDataException {
   accessor.reset(buffer);
   int tupleCount = accessor.getTupleCount();
   try {
     for (int i = 0; i < tupleCount; ) {
       if (lowKey != null) lowKey.reset(accessor, i);
       if (highKey != null) highKey.reset(accessor, i);
       // TODO: currently use low key only, check what they mean
       if (currentTopTuple != null) {
         int cmp = compare(lowKey, currentTopTuple);
         if (cmp == 0) {
           outputMatch(i);
           i++;
         } else if ((cmp > 0)) {
           moveTreeCursor();
         } else {
           writeLeftResults(accessor, i);
           i++;
         }
       } else {
         writeLeftResults(accessor, i);
         i++;
       }
     }
   } catch (Exception e) {
     throw new HyracksDataException(e);
   }
 }
  @Override
  public void nextFrame(ByteBuffer buffer) throws HyracksDataException {
    accessor.reset(buffer);

    int tupleCount = accessor.getTupleCount();
    try {
      for (int i = 0; i < tupleCount; i++) {
        if (lowKey != null) lowKey.reset(accessor, i);
        if (highKey != null) highKey.reset(accessor, i);
        rangePred.setLowKey(lowKey, lowKeyInclusive);
        rangePred.setHighKey(highKey, highKeyInclusive);

        cursor.reset();
        indexAccessor.search(cursor, rangePred);
        writeSearchResults(accessor, i);
      }
    } catch (Exception e) {
      throw new HyracksDataException(e);
    }
  }