Permalink
Browse files

Fixing SlicePredicate, ColumnPath and ColumnParent constructors for 0…

….6 interface
  • Loading branch information...
brianfrankcooper committed Apr 20, 2010
1 parent c98594d commit 06e4fedece3a6f97c1956386f7616f5d07c89b40
Showing with 13 additions and 9 deletions.
  1. +13 −9 src/com/yahoo/ycsb/db/CassandraClient.java
@@ -149,9 +149,8 @@ public int read(String table, String key, Set<String> fields, HashMap<String,Str
sliceRange.setFinish(new byte[0]);
sliceRange.setCount(1000000);
- //predicate = new SlicePredicate(null,new SliceRange(new byte[0], new byte[0],false,1000000));
- predicate = new SlicePredicate(null,sliceRange);
- //predicate.setSlice_range(sliceRange);
+ predicate = new SlicePredicate();
+ predicate.setSlice_range(sliceRange);
}
else
{
@@ -160,9 +159,12 @@ public int read(String table, String key, Set<String> fields, HashMap<String,Str
{
fieldlist.add(s.getBytes("UTF-8"));
}
- predicate = new SlicePredicate(fieldlist,null);
+
+ predicate = new SlicePredicate();
+ predicate.setColumn_names(fieldlist);
}
- ColumnParent parent = new ColumnParent("data", null);
+
+ ColumnParent parent = new ColumnParent("data");
List<ColumnOrSuperColumn> results = client.get_slice(table, key, parent, predicate, ConsistencyLevel.ONE);
if (_debug)
@@ -233,7 +235,8 @@ public int scan(String table, String startkey, int recordcount, Set<String> fiel
sliceRange.setStart(new byte[0]);
sliceRange.setFinish(new byte[0]);
sliceRange.setCount(1000000);
- predicate = new SlicePredicate(null,sliceRange);
+ predicate = new SlicePredicate();
+ predicate.setSlice_range(sliceRange);
}
else
{
@@ -242,9 +245,10 @@ public int scan(String table, String startkey, int recordcount, Set<String> fiel
{
fieldlist.add(s.getBytes("UTF-8"));
}
- predicate = new SlicePredicate(fieldlist,null);
+ predicate = new SlicePredicate();
+ predicate.setColumn_names(fieldlist);
}
- ColumnParent parent = new ColumnParent("data", null);
+ ColumnParent parent = new ColumnParent("data");
List<KeySlice> results = client.get_range_slice(table,parent,predicate,startkey,"",recordcount,ConsistencyLevel.ONE);
@@ -389,7 +393,7 @@ public int delete(String table, String key)
{
try
{
- client.remove(table,key,new ColumnPath("data", null, null),System.currentTimeMillis(),ConsistencyLevel.ONE);
+ client.remove(table,key,new ColumnPath("data"),System.currentTimeMillis(),ConsistencyLevel.ONE);
if (_debug)
{

0 comments on commit 06e4fed

Please sign in to comment.