Permalink
Browse files

Changed how a search range is constructed for the ycsb test

Specifying a range predicate using a Vector -- or any List
derived instance -- of size 2 has been deprecated to allow
for predicate List's.

Signed-off-by: Nick Tolomiczenko <nick.tolomiczenko@gmail.com>
  • Loading branch information...
1 parent 1b6b8dc commit 831c30ac74f5fb7c706efc823ef7304e4e27cb19 @neikos neikos committed Jan 29, 2013
@@ -82,7 +82,7 @@ public static void main(String[] args) throws Exception
predicates.add(new LessEqual(165D));
values.put("weight",predicates);
- System.out.println("\nDo the search again using a List of Predicate based classes.:\n");
+ System.out.println("\nDo the search again using a List of Predicate based classes:\n");
// Do the search again
s = c.search("weightbook",values);
@@ -96,7 +96,7 @@ public static void main(String[] args) throws Exception
predicates.add(new LessEqual(4165551026L));
values.put("phone",predicates);
- System.out.println("\nDo the search again using a List of Predicate based classes.:\n");
+ System.out.println("\nDo the search again using a List of Predicate based classes:\n");
// Do the search again
s = c.search("phonebook",values);
@@ -35,6 +35,7 @@
import java.util.Map;
import java.util.Set;
import java.util.Vector;
+import java.util.AbstractMap;
import java.util.regex.*;
import com.yahoo.ycsb.DB;
@@ -133,10 +134,9 @@ public int scan(String table, String startkey, int recordcount, Set<String> fiel
long upper = (base + recordcount) << 32;
HashMap<String,Object> values = new HashMap<String,Object>();
- Vector<Long> vrange = new Vector<Long>(2);
- vrange.add(lower);
- vrange.add(upper);
- values.put("recno", vrange);
+ AbstractMap.SimpleEntry<Long,Long> range
+ = new AbstractMap.SimpleEntry<Long,Long>(lower,upper);
+ values.put("recno", range);
try
{

0 comments on commit 831c30a

Please sign in to comment.